### Question:
NodeGroup { Set<NodeEndpoint> listEndpointOfMajor() { Set<NodeEndpoint> endpoints = new HashSet<>(); for (GroupMember member : memberMap.values()) { if (member.isMajor()) { endpoints.add(member.getEndpoint()); } } return endpoints; } NodeGroup(NodeEndpoint endpoint);   NodeGroup(Collection<NodeEndpoint> endpoints, NodeId selfId);   }### Answer:
@Test public void testListEndpointOfMajor() { 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")); group.addNode(new NodeEndpoint("D", "localhost", 2336), 10, 0, false); Assert.assertEquals(3, group.listEndpointOfMajor().size()); }