@Test public void testListReplicationTarget() { 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.resetReplicatingStates(1); Collection<GroupMember> replicatingStates = group.listReplicationTarget(); Assert.assertEquals(2, replicatingStates.size()); Set<NodeId> nodeIds = replicatingStates.stream().map(GroupMember::getId).collect(Collectors.toSet()); Assert.assertFalse(nodeIds.contains(NodeId.of("A"))); }
Collection<GroupMember> listReplicationTarget() { return memberMap.values().stream().filter(m -> !m.idEquals(selfId)).collect(Collectors.toList()); }
NodeGroup { Collection<GroupMember> listReplicationTarget() { return memberMap.values().stream().filter(m -> !m.idEquals(selfId)).collect(Collectors.toList()); } }
NodeGroup { Collection<GroupMember> listReplicationTarget() { return memberMap.values().stream().filter(m -> !m.idEquals(selfId)).collect(Collectors.toList()); } NodeGroup(NodeEndpoint endpoint);   NodeGroup(Collection<NodeEndpoint> endpoints, NodeId selfId); }
NodeGroup { Collection<GroupMember> listReplicationTarget() { return memberMap.values().stream().filter(m -> !m.idEquals(selfId)).collect(Collectors.toList()); } NodeGroup(NodeEndpoint endpoint);   NodeGroup(Collection<NodeEndpoint> endpoints, NodeId selfId);  }
NodeGroup { Collection<GroupMember> listReplicationTarget() { return memberMap.values().stream().filter(m -> !m.idEquals(selfId)).collect(Collectors.toList()); } NodeGroup(NodeEndpoint endpoint);   NodeGroup(Collection<NodeEndpoint> endpoints, NodeId selfId);   }