@Override
    public <T extends TraversalStrategy> Optional<T> getStrategy(final Class<T> traversalStrategyClass) {
        for (final TraversalStrategy<?> traversalStrategy : this.traversalStrategies) {
            if (traversalStrategyClass.isAssignableFrom(traversalStrategy.getClass()))
                return (Optional) Optional.of(traversalStrategy);
        }
        return Optional.empty();
    }
@author Marko A. Rodriguez (http://markorodriguez.com)
gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/util/DefaultTraversalStrategies.java