public default <T extends TraversalStrategy> Optional<T> getStrategy(final Class<T> traversalStrategyClass) {
        return (Optional<T>) IteratorUtils.stream(iterator()).
                filter(s -> traversalStrategyClass.isAssignableFrom(s.getClass())).findAny();
    }
Return the {@link TraversalStrategy} instance associated with the provided class.

@param traversalStrategyClass the class of the strategy to get
@param <T>                    the strategy class type
@return an optional containing the strategy instance or not
gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/TraversalStrategies.java