code: public static boolean isDuplicated(final String input) {
      int len = input.length();
      if (len % 2 == 0) {
        int half = len / 2;
        if (hasEqualParts(input, half, half)) {
          return true;
        }
        if (input.substring(half, half + 1).equals(" ")
            && input.substring(half - 1, half).matches("[;,]")) {
          return hasEqualParts(input, half - 1, half + 1);
        }
      } else {
        int half = len / 2;
        String middlePart = input.substring(half - 1, half + 2);
        if (isSpaceCommaSpace(middlePart)) {
          return hasEqualParts(input, half - 1, half + 2);
        } else if (isCommaInTheMiddle(middlePart)
                   || isLineBreakInTheMiddle(middlePart)) {
          return hasEqualParts(input, half, half + 1);
        }
      }
      return false;
    }
docs: Checks if the string is a duplication is a substring.
  
  @param input The input string
  @return
  True is the string is a duplication.