MgcpCall { public Set<String> getEndpoints() { return Collections.unmodifiableSet(this.entries.keySet()); } MgcpCall(int callId); int getCallId(); String getCallIdHex(); Set<String> getEndpoints(); Set<Integer> getConnections(String endpointId); boolean addConnection(String endpointId, int connectionId); boolean removeConnection(String endpointId, int connectionId); Set<Integer> removeConnections(String endpointId);  }
@Test(expected = UnsupportedOperationException.class) public void testUnmodifiableEndpointQuery() { final int callId = 10; final MgcpCall call = new MgcpCall(callId); final Set<String> endpoints = call.getEndpoints(); endpoints.add("boom!"); }