public void testEnumWithMethods() throws Exception {
String in = ""
+ "enum Animal {"
+ " DUCK { public void speak() { System.out.println(\"quack!\"); } }"
+ "}";
Lexer lexer = new JFlexLexer(new StringReader(in));
assertLex(Parser.ENUM, lexer);
assertLex(Parser.IDENTIFIER, lexer);
assertLex(Parser.BRACEOPEN, lexer);
assertLex(Parser.IDENTIFIER, lexer);
assertLex(Parser.CODEBLOCK, lexer);