### Question:
DateFormatParser { public static List<? extends Token> tokenize(String format) { DateFormat lexer = new io.prestosql.teradata.functions.DateFormat(new ANTLRInputStream(format)); return lexer.getAllTokens(); } private  DateFormatParser(); static DateTimeFormatter createDateTimeFormatter(String format); static List<? extends Token> tokenize(String format);  }### Answer:
@Test public void testTokenize() { assertEquals( DateFormatParser.tokenize("yyyy mm").stream().map(Token::getType).collect(Collectors.toList()), asList(DateFormat.YYYY, DateFormat.TEXT, DateFormat.MM)); }
@Test public void testGreedinessLongFirst() { assertEquals(1, DateFormatParser.tokenize("yy").size()); assertEquals(1, DateFormatParser.tokenize("yyyy").size()); assertEquals(2, DateFormatParser.tokenize("yyyyyy").size()); }
@Test public void testInvalidTokenTokenize() { assertEquals( DateFormatParser.tokenize("ala").stream().map(Token::getType).collect(Collectors.toList()), asList(DateFormat.UNRECOGNIZED, DateFormat.UNRECOGNIZED, DateFormat.UNRECOGNIZED)); }