### Question:
PeerBucket { synchronized void addPeer(Peer peer) { if (!bumpOrAdd(peer)) { addReplacement(peer); } } PeerBucket(int depth); int getPeersCount(); synchronized void bump(Peer peer);  }### Answer:
@Test public void testAddPeer() { KademliaOptions.BUCKET_SIZE = 5; addPeerToBucket(32920, 32930); assertEquals(5, bucket.getPeersCount()); assertEquals(5, bucket.getReplacements().size()); assertTrue(getLastPeer(Peer.valueOf("ynode: Peer lastPeerOfReplacements = bucket.getReplacements() .stream() .skip(bucket.getReplacements().size() - 1) .findFirst() .orElse(null); assertEquals(lastPeerOfReplacements, Peer.valueOf("ynode: }