private void verifyBadParseString(String pattern, String string) {
    formatter = new HiveSqlDateTimeFormatter(pattern, true,
        Optional.of(LocalDateTime.ofInstant(Instant.EPOCH, ZoneOffset.UTC)));
    try {
      Timestamp output = formatter.parseTimestamp(string);
      fail("Parse string to timestamp should have failed.\nString: " + string + "\nPattern: "
          + pattern + ", output = " + output);
    } catch (Exception e) {
      assertEquals("Expected IllegalArgumentException, got another exception:" + e,
          IllegalArgumentException.class.getName(), e.getClass().getName());
    }
  }
Verify pattern is parsed correctly.
Check:
-token.temporalField for each token
-sum of token.lengths
-concatenation of token.strings
common/src/test/org/apache/hadoop/hive/common/format/datetime/TestHiveSqlDateTimeFormatter.java