@Test
    public void shouldOnlyLog() {
        final String repr = traversal.getGremlinLang().getGremlin("__");
        final TraversalStrategies strategies = new DefaultTraversalStrategies();
        final ReservedKeysVerificationStrategy.Builder builder = ReservedKeysVerificationStrategy.build().logWarning();
        if (repr.equals("__.addV().property(\"x\",\"xyz\",\"not-allowed\",\"xxx\")"))
            builder.reservedKeys(new HashSet<>(Arrays.asList("id", "label", "not-allowed")));
        strategies.addStrategies(builder.create());
        final Traversal traversal = this.traversal.asAdmin().clone();
        traversal.asAdmin().setStrategies(strategies);
        traversal.asAdmin().applyStrategies();
        if (!allow) {
            assertThat(String.format("Expected log entry not found in %s for %s", logCaptor.getLogs(), repr),
                    logCaptor.getLogs().stream().anyMatch(MSG_PREDICATE));
        }
    }
@author Stephen Mallette (http://stephen.genoprime.com)
gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/verification/ReservedKeysVerificationStrategyTest.java