@Test
    public void shouldProvideClearErrorWhenPuttingFromToInWrongSpot() {
        final GraphTraversalSource g = TinkerFactory.createModern().traversal();

        try {
            g.addE("link").property(VertexProperty.Cardinality.single, "k", 100).out().
                    to(__.V(1)).from(__.V(1)).iterate();
            fail("Should have thrown an error");
        } catch (IllegalArgumentException ise) {
            assertEquals("The to() step cannot follow VertexStep", ise.getMessage());
        }

        try {
            g.addE("link").property("k", 100).out().
                    from(__.V(1)).to(__.V(1)).iterate();
            fail("Should have thrown an error");
        } catch (IllegalArgumentException ise) {
            assertEquals("The from() step cannot follow VertexStep", ise.getMessage());
        }
    }
Validating that mid-traversal hasId() also unwraps ids in lists in addition to ids in arrays as per TINKERPOP-2863
tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/TinkerGraphTest.java