### Question:
NodeTable { public int getBucketsCount() { int i = 0; for (NodeBucket b : buckets) { if (b.getNodesCount() > 0) { i++; } } return i; } NodeTable(Node n); Node getNode(); final void initialize(); synchronized Node addNode(Node n); synchronized void dropNode(Node n); synchronized boolean contains(Node n); synchronized void touchNode(Node n); int getBucketsCount(); synchronized NodeBucket[] getBuckets(); int getBucketId(NodeEntry e); synchronized int getNodesCount(); synchronized List<NodeEntry> getAllNodes(); synchronized List<Node> getClosestNodes(byte[] targetId);  }### Answer:
@Test public void getBucketsCountTest() { Assert.assertEquals(0, nodeTable.getBucketsCount()); Node node = new Node(ids.get(0), ips[0], 18888, 18888); nodeTable.addNode(node); Assert.assertEquals(1, nodeTable.getBucketsCount()); }