@Test
    public void shouldBeVerifiedIllegal() {
        final String repr = traversal.getGremlinLang().getGremlin();
        final TraversalStrategies strategies = new DefaultTraversalStrategies();
        strategies.addStrategies(ProfileStrategy.instance());
        strategies.addStrategies(LambdaRestrictionStrategy.instance());
        traversal.asAdmin().setStrategies(strategies);
        if (allow) {
            traversal.asAdmin().applyStrategies();
        } else {
            try {
                traversal.asAdmin().applyStrategies();
                fail("The strategy should not allow lambdas: " + repr);
            } catch (VerificationException ise) {
                assertThat(ise.getMessage(), containsString("lambda"));
            }
        }
    }
@author Marko A. Rodriguez (http://markorodriguez.com)
gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/verification/LambdaRestrictionStrategyTest.java