private void verifyPatternParsing(String pattern, int expectedPatternLength,
      String expectedPattern, List<TemporalField> temporalFields) {
    formatter = new HiveSqlDateTimeFormatter(pattern, false,
        Optional.of(LocalDateTime.ofInstant(Instant.EPOCH, ZoneOffset.UTC)));
    assertEquals(temporalFields.size(), formatter.getTokens().size());
    StringBuilder sb = new StringBuilder();
    int actualPatternLength = 0;
    for (int i = 0; i < temporalFields.size(); i++) {
      assertEquals("Generated list of tokens not correct", temporalFields.get(i),
          formatter.getTokens().get(i).temporalField);
      sb.append(formatter.getTokens().get(i).string);
      actualPatternLength += formatter.getTokens().get(i).length;
    }
    assertEquals("Token strings concatenated don't match original pattern string",
        expectedPattern, sb.toString());
    assertEquals(expectedPatternLength, actualPatternLength);
  }
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