@Test public void testListEndpointOfMajorExceptSelf() { 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")); Assert.assertEquals(2, group.listEndpointOfMajorExceptSelf().size()); }
Set<NodeEndpoint> listEndpointOfMajorExceptSelf() { Set<NodeEndpoint> endpoints = new HashSet<>(); for (GroupMember member : memberMap.values()) { if (member.isMajor() && !member.idEquals(selfId)) { endpoints.add(member.getEndpoint()); } } return endpoints; }
NodeGroup { Set<NodeEndpoint> listEndpointOfMajorExceptSelf() { Set<NodeEndpoint> endpoints = new HashSet<>(); for (GroupMember member : memberMap.values()) { if (member.isMajor() && !member.idEquals(selfId)) { endpoints.add(member.getEndpoint()); } } return endpoints; } }
NodeGroup { Set<NodeEndpoint> listEndpointOfMajorExceptSelf() { Set<NodeEndpoint> endpoints = new HashSet<>(); for (GroupMember member : memberMap.values()) { if (member.isMajor() && !member.idEquals(selfId)) { endpoints.add(member.getEndpoint()); } } return endpoints; } NodeGroup(NodeEndpoint endpoint);   NodeGroup(Collection<NodeEndpoint> endpoints, NodeId selfId); }
NodeGroup { Set<NodeEndpoint> listEndpointOfMajorExceptSelf() { Set<NodeEndpoint> endpoints = new HashSet<>(); for (GroupMember member : memberMap.values()) { if (member.isMajor() && !member.idEquals(selfId)) { endpoints.add(member.getEndpoint()); } } return endpoints; } NodeGroup(NodeEndpoint endpoint);   NodeGroup(Collection<NodeEndpoint> endpoints, NodeId selfId);  }
NodeGroup { Set<NodeEndpoint> listEndpointOfMajorExceptSelf() { Set<NodeEndpoint> endpoints = new HashSet<>(); for (GroupMember member : memberMap.values()) { if (member.isMajor() && !member.idEquals(selfId)) { endpoints.add(member.getEndpoint()); } } return endpoints; } NodeGroup(NodeEndpoint endpoint);   NodeGroup(Collection<NodeEndpoint> endpoints, NodeId selfId);   }