private void validateTreeStructure(final Tree<?> actualTree, final TreeNode expectedNode) {
        assertEquals(expectedNode.getChildren().size(), actualTree.keySet().size());
        for (TreeNode child : expectedNode.getChildren()) {
            assertThat(String.format("Tree not matching at %s", child.getValue()),
                    actualTree.containsKey(child.getValue()), CoreMatchers.is(true));
            validateTreeStructure(actualTree.get(child.getValue()), child);
        }
    }
Some implementations of {@link VertexProperty} are not {@code Serializable} and may lead to test failures when passed as
parameters. One such instance is {@code HadoopVertexProperty}. This method detaches vertex properties as tests
should never require implementation-specific elements.
gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/features/StepDefinition.java