Topology topology = new Topology();
InetAddress address = InetAddress.getLocalHost();
NodeInfo node1 = new NodeInfo("node1", address, 8080);
NodeInfo node2 = new NodeInfo("node2", address, 8080);
NodePath path1 = new NodePath(node1, node2, weight10, weight10);
topology.addPath(path1);
NodeInfo[] path = topology.getPath(node1, node2);
assertEquals(1, path.length);
NodeInfo node3 = new NodeInfo("node3", address, 8080);
NodePath path2 = new NodePath(node2, node3, weight10, weight10);
topology.addPath(path2);
path = topology.getPath(node1, node3);
assertEquals(2, path.length);
NodeInfo node4 = new NodeInfo("node4", address, 8080);
NodePath path3 = new NodePath(node3, node4, weight10, weight10);
topology.addPath(path3);
path = topology.getPath(node1, node4);
assertEquals(3, path.length);
topology.removePath(path3);
path = topology.getPath(node1, node4);
assertNull(path);
path3 = new NodePath(node3, node1, weight30, weight10);
topology.addPath(path3);
path = topology.getPath(node1, node3);
assertEquals(1, path.length);
path = topology.getPath(node3, node1);
assertEquals(2, path.length);