@Override
    public void apply(final Traversal.Admin<?, ?> traversal) {
        boolean changed = true; // recursively walk child traversals trying to inline them into the current traversal line.
        while (changed) {
            changed = false;
            final Iterator<FilterStep> filterStepIterator = TraversalHelper.getStepsOfAssignableClass(FilterStep.class, traversal).iterator();
            while (!changed && filterStepIterator.hasNext()) {
                final FilterStep<?> step = filterStepIterator.next();
                changed = step instanceof HasStep && InlineFilterStrategy.processHasStep((HasStep) step, traversal) ||
                        step instanceof TraversalFilterStep && InlineFilterStrategy.processTraversalFilterStep((TraversalFilterStep) step, traversal) ||
                        step instanceof OrStep && InlineFilterStrategy.processOrStep((OrStep) step, traversal) ||
                        step instanceof AndStep && InlineFilterStrategy.processAndStep((AndStep) step, traversal);
            }
            if (!changed && traversal.isRoot()) {
                final Iterator<MatchStep> matchStepIterator = TraversalHelper.getStepsOfClass(MatchStep.class, traversal).iterator();
                while (!changed && matchStepIterator.hasNext()) {
                    if (InlineFilterStrategy.processMatchStep(matchStepIterator.next(), traversal))
                        changed = true;
                }
            }
        }
    }
This strategy analyzes filter-steps with child traversals that themselves are pure filters. If the child traversals
are pure filters then the wrapping parent filter is not needed and thus, the children can be "inlined." Normalizing
pure filters with inlining reduces the number of variations of a filter that a graph provider may need to reason
about when writing their own strategies. As a result, this strategy helps increase the likelihood that a provider's
filtering optimization will succeed at re-writing the traversal.

@author Marko A. Rodriguez (http://markorodriguez.com)
@example <pre>
__.outE().hasLabel(eq("knows").or(eq("created"))).inV()       // is replaced by __.outE("knows", "created").inV()
__.filter(has("name","marko"))                                // is replaced by __.has("name","marko")
__.and(has("name"),has("age"))                                // is replaced by __.has("name").has("age")
__.and(filter(has("name","marko").has("age")),hasNot("blah")) // is replaced by __.has("name","marko").has("age").hasNot("blah")
__.match(as('a').has(key,value),...)                          // is replaced by __.as('a').has(key,value).match(...)
</pre>
gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/InlineFilterStrategy.java