private static TraversalStrategy tryToConstructStrategy(final String strategyName, final Configuration conf) {
        // try to grab the strategy class from registered sources
        final Optional<? extends Class<? extends TraversalStrategy>> opt = TraversalStrategies.GlobalCache.getRegisteredStrategyClass(strategyName);

        if (!opt.isPresent())
            throw new IllegalStateException("TraversalStrategy not recognized - " + strategyName);

        final Class clazz = opt.get();
        try {
            // if there is no configuration then we can use the instance() method and if that fails the public
            // constructor, followed by the standard create(). otherwise we need to pass the Configuration to the
            // create() method
            if (conf.isEmpty()) {
                try {
                    return (TraversalStrategy) clazz.getMethod("instance").invoke(null);
                } catch (Exception ex) {
                    try {
                        return (TraversalStrategy) clazz.getConstructor().newInstance();
                    } catch (Exception exinner) {
                        return (TraversalStrategy) clazz.getMethod("create", Configuration.class).invoke(null, conf);
                    }
                }
            } else {
                return (TraversalStrategy) clazz.getMethod("create", Configuration.class).invoke(null, conf);
            }
        } catch (Exception ex) {
            throw new IllegalStateException("TraversalStrategy cannot be instantiated - " + strategyName, ex);
        }
    }
Try to instantiate the strategy by checking registered {@link TraversalStrategy} implementations that are
registered globally. Only strategies that are registered globally can be constructed in this way.
gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/language/grammar/TraversalStrategyVisitor.java