@Test
        public void shouldParseAllEnumTypes() throws ClassNotFoundException, NoSuchMethodException, IllegalAccessException, InvocationTargetException {
            final Class<? extends Enum> enumType = (Class<? extends Enum>) (Class.forName(className));
            for (Enum enumConstant : enumType.getEnumConstants()) {
                final GremlinLexer lexer = new GremlinLexer(CharStreams.fromString(enumConstant.name()));
                final GremlinParser parser = new GremlinParser(new CommonTokenStream(lexer));

                final Method method = parser.getClass().getMethod(parseMethodName);
                final ParseTree ctx = (ParseTree) (method.invoke(parser));
                assertEquals(enumConstant, TraversalEnumParser.parseTraversalEnumFromContext(enumType, ctx));
            }
        }
Test for parse Graph traversal enums
gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/language/grammar/TraversalEnumParserTest.java