code: private static boolean hasEqualParts(final String input,
                                         final int beginTo,
                                         final int endFrom) {
      String begin = input.substring(0, beginTo);
      String end = input.substring(endFrom);
      return begin.equals(end);
    }
docs: Checks if a string's beginning and end are equal.
  
  @param input The input string
  @param beginTo The beginning string ends at this point.
  @param endFrom The ending string starts from this point.
  @return
  True if the two parts are equals, otherwise false.