@Test(expected = IllegalArgumentException.class) public void testFindMemberNotFound() { NodeEndpoint endpoint = new NodeEndpoint("A", "localhost", 2333); NodeGroup group = new NodeGroup(endpoint); Assert.assertNotNull(group.findMember(NodeId.of("B"))); }
@Nonnull GroupMember findMember(NodeId id) { GroupMember member = getMember(id); if (member == null) { throw new IllegalArgumentException("no such node " + id); } return member; }
NodeGroup { @Nonnull GroupMember findMember(NodeId id) { GroupMember member = getMember(id); if (member == null) { throw new IllegalArgumentException("no such node " + id); } return member; } }
NodeGroup { @Nonnull GroupMember findMember(NodeId id) { GroupMember member = getMember(id); if (member == null) { throw new IllegalArgumentException("no such node " + id); } return member; } NodeGroup(NodeEndpoint endpoint);   NodeGroup(Collection<NodeEndpoint> endpoints, NodeId selfId); }
NodeGroup { @Nonnull GroupMember findMember(NodeId id) { GroupMember member = getMember(id); if (member == null) { throw new IllegalArgumentException("no such node " + id); } return member; } NodeGroup(NodeEndpoint endpoint);   NodeGroup(Collection<NodeEndpoint> endpoints, NodeId selfId);  }
NodeGroup { @Nonnull GroupMember findMember(NodeId id) { GroupMember member = getMember(id); if (member == null) { throw new IllegalArgumentException("no such node " + id); } return member; } NodeGroup(NodeEndpoint endpoint);   NodeGroup(Collection<NodeEndpoint> endpoints, NodeId selfId);   }