@Test
    public void shouldEnforceMultipleUniqueConstraint() {
        this.graph.tx().readWrite();
        this.getBaseGraph().execute("CREATE CONSTRAINT ON (p:Person) assert p.name is unique", null);
        this.getBaseGraph().execute("CREATE CONSTRAINT ON (p:Person) assert p.surname is unique", null);
        this.graph.tx().commit();
        this.graph.addVertex(T.label, "Person", "name", "marko");
        this.graph.addVertex(T.label, "Person", "surname", "aaaa");
        this.graph.tx().commit();
        boolean failSurname = false;
        try {
            this.graph.addVertex(T.label, "Person", "surname", "aaaa");
        } catch (RuntimeException e) {
            if (isConstraintViolation(e)) failSurname = true;
        }
        assertTrue(failSurname);
        boolean failName = false;
        try {
            this.graph.addVertex(T.label, "Person", "name", "marko");
        } catch (RuntimeException e) {
            if (isConstraintViolation(e)) failName = true;
        }
        assertTrue(failName);
        this.graph.tx().commit();
    }
@author Marko A. Rodriguez (http://markorodriguez.com)
neo4j-gremlin/src/test/java/org/apache/tinkerpop/gremlin/neo4j/structure/NativeNeo4jIndexCheck.java