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