@Test public void testUnlinkIn(){ String label = "knows"; Person p3 = fg.addVertex(Person.class); Person p4 = fg.addVertex(Person.class); Person p5 = fg.addVertex(Person.class); p4.addEdge(label, p3, Knows.class); p5.addEdge(label, p3, Knows.class); long allInEdgesCount = p3.in(label).count(); Long targetVertex_InEdgeCount = p3.in(label).mark().retain(Lists.newArrayList(p4)).back().count(); Assert.assertTrue("target vertex requires an in edge for " + label, targetVertex_InEdgeCount > 0); Assert.assertTrue("Multiple edges(in) of type "+label+" must exist for vertice", allInEdgesCount - targetVertex_InEdgeCount > 0); p3.unlinkIn(p4, label); Assert.assertEquals("All " + label + " edges(in) should have been removed from given vertex", 0, p3.in(label).retain(Lists.newArrayList(p4)).count()); Assert.assertTrue("All " + label + " edges(in) should have remained for other vertices", p3.inE(label).count() > 0); }
protected void unlinkIn(FramedVertex vertex, String... labels) { if (vertex != null) { inE(labels).mark().outV().retain(vertex).back().removeAll(); } else { inE(labels).removeAll(); } }
FramedVertex extends FramedElement { protected void unlinkIn(FramedVertex vertex, String... labels) { if (vertex != null) { inE(labels).mark().outV().retain(vertex).back().removeAll(); } else { inE(labels).removeAll(); } } }
FramedVertex extends FramedElement { protected void unlinkIn(FramedVertex vertex, String... labels) { if (vertex != null) { inE(labels).mark().outV().retain(vertex).back().removeAll(); } else { inE(labels).removeAll(); } }  }
FramedVertex extends FramedElement { protected void unlinkIn(FramedVertex vertex, String... labels) { if (vertex != null) { inE(labels).mark().outV().retain(vertex).back().removeAll(); } else { inE(labels).removeAll(); } }  JsonObject toJson(); @Override String toString(); }
FramedVertex extends FramedElement { protected void unlinkIn(FramedVertex vertex, String... labels) { if (vertex != null) { inE(labels).mark().outV().retain(vertex).back().removeAll(); } else { inE(labels).removeAll(); } }  JsonObject toJson(); @Override String toString();  }