@Test
    public void shouldHaveSubPathPopSupport() {
        PATH_SUPPLIERS.forEach(supplier -> {
            Path path = supplier.get();
            path = path.extend("marko", Collections.singleton("a"));
            path = path.extend("stephen", Collections.singleton("a"));
            path = path.extend("matthias", new HashSet<>(Arrays.asList("c", "x")));
            path = path.extend("bob", Collections.singleton("c"));
            assertEquals(4, path.size());
            assertEquals(4, path.objects().size());
            assertEquals(4, path.labels().size());
            ///
            Path subPath = path.subPath("a", "c");
            assertEquals(3, subPath.size());
            assertEquals(3, subPath.objects().size());
            assertEquals(3, subPath.labels().size());
            assertEquals("stephen", subPath.objects().get(0));
            assertEquals("matthias", subPath.objects().get(1));
            assertEquals("bob", subPath.objects().get(2));
            assertTrue(subPath.labels().get(0).contains("a"));
            assertEquals(1, subPath.labels().get(0).size());
            assertTrue(subPath.labels().get(1).contains("c"));
            assertTrue(subPath.labels().get(1).contains("x"));
            assertEquals(2, subPath.labels().get(1).size());
            assertTrue(subPath.labels().get(2).contains("c"));
            assertEquals(1, subPath.labels().get(2).size());
        });
    }
@author Marko A. Rodriguez (http://markorodriguez.com)
gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/PathTest.java