private boolean setPredicateValues(final P<Object> predicate, final Traverser.Admin<S> traverser, final Iterator<String> selectKeysIterator) {
        if (predicate instanceof ConnectiveP) {
            for (P<Object> p : ((ConnectiveP<Object>) predicate).getPredicates()) {
                if (!this.setPredicateValues(p, traverser, selectKeysIterator))
                    return false;
            }

            return true;
        } else {
            final TraversalProduct product = TraversalUtil.produce((S) this.getSafeScopeValue(Pop.last, selectKeysIterator.next(), traverser), this.traversalRing.next());
            if (product.isProductive())
                predicate.setValue(product.get());

            return product.isProductive();
        }
    }
@author Marko A. Rodriguez (http://markorodriguez.com)
gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/filter/WherePredicateStep.java