private boolean isLastCharacterOfSeparator(int index, String string) {
    if (index == string.length() - 1) { // if we're at the end of the string, yes
      return true;
    }
    return !VALID_SEPARATORS.contains(string.substring(index + 1, index + 2));
  }
Is the next character something other than a separator?
common/src/java/org/apache/hadoop/hive/common/format/datetime/HiveSqlDateTimeFormatter.java