@Test
    public void shouldHaveStandardSemanticsImplementedCorrectly() {
        PATH_SUPPLIERS.forEach(supplier -> {
            Path path = supplier.get();
            assertTrue(path.isSimple());
            assertEquals(0, path.size());
            path = path.extend(1, Collections.singleton("a"));
            path = path.extend(2, Collections.singleton("b"));
            path = path.extend(3, Collections.singleton("c"));
            assertEquals(3, path.size());
            assertEquals(Integer.valueOf(1), path.get("a"));
            assertEquals(Integer.valueOf(2), path.get("b"));
            assertEquals(Integer.valueOf(3), path.get("c"));
            path = path.extend(Collections.singleton("d"));
            assertEquals(3, path.size());
            assertEquals(Integer.valueOf(1), path.get("a"));
            assertEquals(Integer.valueOf(2), path.get("b"));
            assertEquals(Integer.valueOf(3), path.get("c"));
            assertEquals(Integer.valueOf(3), path.get("d"));
            assertTrue(path.hasLabel("a"));
            assertTrue(path.hasLabel("b"));
            assertTrue(path.hasLabel("c"));
            assertTrue(path.hasLabel("d"));
            assertFalse(path.hasLabel("e"));
            assertTrue(path.isSimple());
            path = path.extend(3, Collections.singleton("e"));
            assertFalse(path.isSimple());
            assertTrue(path.hasLabel("e"));
            assertEquals(4, path.size());
            assertEquals(Integer.valueOf(1), path.get(0));
            assertEquals(Integer.valueOf(2), path.get(1));
            assertEquals(Integer.valueOf(3), path.get(2));
            assertEquals(Integer.valueOf(3), path.get(3));
            Path retractedPath = path.retract(Collections.singleton("f")).clone();
            assertFalse(path.hasLabel("f"));
            assertEquals(4, path.size());
            assertEquals(retractedPath, path);
            path = path.retract(Collections.singleton("b"));
            assertFalse(path.hasLabel("b"));
            assertEquals(3, path.size());
            assertEquals(retractedPath.retract(Collections.singleton("b")), path);
            path = path.retract(Collections.singleton("a"));
            assertEquals(2, path.size());
            assertFalse(path.hasLabel("a"));
            assertTrue(path.hasLabel("d"));
            path = path.retract(new HashSet<>(Arrays.asList("c", "d")));
            assertFalse(path.hasLabel("c"));
            assertFalse(path.hasLabel("d"));
            assertTrue(path.hasLabel("e"));
            assertEquals(1, path.size());
            path = path.retract(Collections.singleton("e"));
            assertFalse(path.hasLabel("c"));
            assertFalse(path.hasLabel("d"));
            assertFalse(path.hasLabel("e"));
            assertNotEquals(retractedPath, path);
            assertEquals(0, path.size());
        });
    }
@author Marko A. Rodriguez (http://markorodriguez.com)
gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/PathTest.java