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

        try {
            g.E().property(VertexProperty.Cardinality.single, "k", 100).iterate();
            fail("Should have thrown an error");
        } catch (IllegalStateException ise) {
            assertEquals("Property cardinality can only be set for a Vertex but the traversal encountered TinkerEdge for key: k", ise.getMessage());
        }

        try {
            g.E().property(VertexProperty.Cardinality.list, "k", 100).iterate();
            fail("Should have thrown an error");
        } catch (IllegalStateException ise) {
            assertEquals("Property cardinality can only be set for a Vertex but the traversal encountered TinkerEdge for key: k", ise.getMessage());
        }

        try {
            g.addE("link").to(__.V(1)).from(__.V(1)).
                    property(VertexProperty.Cardinality.list, "k", 100).iterate();
            fail("Should have thrown an error");
        } catch (IllegalStateException ise) {
            assertEquals("Multi-property cardinality of [list] can only be set for a Vertex but is being used for addE() with key: k", 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