### Question:
NodeGroup { void removeNode(NodeId id) { logger.info("node {} removed", id); memberMap.remove(id); } NodeGroup(NodeEndpoint endpoint);   NodeGroup(Collection<NodeEndpoint> endpoints, NodeId selfId);   }### Answer:
@Test public void testRemoveNode() { Set<NodeEndpoint> endpoints = new HashSet<>(); endpoints.add(new NodeEndpoint("A", "localhost", 2333)); endpoints.add(new NodeEndpoint("B", "localhost", 2334)); endpoints.add(new NodeEndpoint("C", "localhost", 2335)); NodeGroup group = new NodeGroup(endpoints, NodeId.of("A")); NodeId nodeId = NodeId.of("B"); Assert.assertNotNull(group.getMember(nodeId)); group.removeNode(nodeId); Assert.assertNull(group.getMember(nodeId)); }