static String getTailFromPage(String nextPageText, int tailLength) {
    return tailLength < nextPageText.length() ?
           nextPageText.substring(0, tailLength) : nextPageText;
  }
static String getTailFromPage(String nextPageText, int tailLength)