ServiceData { public boolean removeEndpoint(final Endpoint endpoint) { if (endpoint == null) { throw new IllegalArgumentException("Endpoint can't be null"); } synchronized (syncObject) { if (!endpoints.containsKey(endpoint.getName())) { return false; } endpoints.remove(endpoint.getName()); } return true; } ServiceData();   ServiceData(final List<Endpoint> endpointList); Endpoint getEndpoint(final String name); boolean addEndpoint(final Endpoint endpoint); boolean removeEndpoint(final Endpoint endpoint);  }
@Test (expected = IllegalArgumentException.class) public void removeNullEndpoint() { final ServiceData data = new ServiceData(); data.removeEndpoint(null); }