@Test public void testRemoveNodeIndexStaysConstant() { assertEquals(0, net.getNodeCount()); CyNode n0 = net.addNode(); CyNode n1 = net.addNode(); long n0i = n0.getSUID(); long n1i = n1.getSUID(); net.removeNodes(Collections.singletonList(n0)); long nnli = n1.getSUID(); assertEquals(nnli, n1i); }
@Test public void testRemoveNodeGetNodeFromIndex() { assertEquals(0, net.getNodeCount()); CyNode n0 = net.addNode(); CyNode n1 = net.addNode(); long n0i = n0.getSUID(); long n1i = n1.getSUID(); assertEquals(net.getNode(n0i), n0); assertEquals(net.getNode(n1i), n1); assertTrue(net.removeNodes(Collections.singletonList(n0))); assertNull(net.getNode(n0i)); assertEquals(n1, net.getNode(n1i)); }