SocketIoMemoryAdapter extends SocketIoAdapter { @Override public synchronized void remove(String room, SocketIoSocket socket) throws IllegalArgumentException { if (room == null) { throw new IllegalArgumentException("room must not be null."); } if (socket == null) { throw new IllegalArgumentException("socket must not be null."); } if (mRoomSockets.containsKey(room)) { final Set<SocketIoSocket> roomSockets = mRoomSockets.get(room); roomSockets.remove(socket); if (roomSockets.size() == 0) { mRoomSockets.remove(room); } } if (mSocketRooms.containsKey(socket.getId())) { final Set<String> socketRooms = mSocketRooms.get(socket.getId()); socketRooms.remove(room); if (socketRooms.size() == 0) { mSocketRooms.remove(socket.getId()); } } } private  SocketIoMemoryAdapter(SocketIoNamespace namespace); @Override synchronized void broadcast(Packet packet, String[] rooms, String[] socketsExcluded); @Override synchronized void add(String room, SocketIoSocket socket); @Override synchronized void remove(String room, SocketIoSocket socket); @Override SocketIoSocket[] listClients(String room); @Override String[] listClientRooms(SocketIoSocket socket);  }
@Test(expected = IllegalArgumentException.class) public void test_remove_exception_on_null_room() { final SocketIoAdapter adapter = ADAPTER_FACTORY.createAdapter(null); adapter.remove(null, Mockito.mock(SocketIoSocket.class)); }
@Test(expected = IllegalArgumentException.class) public void test_remove_exception_on_null_socket() { final SocketIoAdapter adapter = ADAPTER_FACTORY.createAdapter(null); adapter.remove("foo", null); }