FramedVertex extends FramedElement { protected void setLinkBoth(FramedVertex vertex, String... labels) { unlinkBoth(null, labels); if (vertex != null) { linkBoth(vertex, labels); } }  JsonObject toJson(); @Override String toString();  }
@Test public void testSetLinkBoth(){ 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); p3.addEdge(label, p4, Knows.class); Assert.assertTrue("An in edge of type " + label + " must exist between vertices", p3.in(label).retain(Lists.newArrayList(p4)).count() > 0); Assert.assertTrue("An out edge of type "+label+" must exist between vertices", p3.out(label).retain(Lists.newArrayList(p4)).count() > 0); p3.setLinkBoth(p5, label); Assert.assertEquals("old " + label + " edge in was not removed", 0, p3.in(label).retain(Lists.newArrayList(p4)).count()); Assert.assertEquals("old " + label + " edge out was not removed", 0, p3.out(label).retain(Lists.newArrayList(p4)).count()); Assert.assertEquals(label + " in edge was not created", 1, p3.in(label).retain(Lists.newArrayList(p5)).count()); Assert.assertEquals(label + " out edge was not created", 1, p3.out(label).retain(Lists.newArrayList(p5)).count()); }