/** Tests the clear() method */ @Test public void testClear() throws Exception { RandomRoutingTable rt = new BasicRandomRoutingTable(); // create a set of neighbors and add them to the table List<TrustGraphNodeId> neighbors = createNeighbors(100); rt.addNeighbors(neighbors); // verify that they're all there for (TrustGraphNodeId n : neighbors) { assertTrue(rt.contains(n)); } // clear the table rt.clear(); // verify that they're all not there for (TrustGraphNodeId n : neighbors) { assertFalse(rt.contains(n)); } assertTrue(rt.isEmpty()); }