class SocketIoMemoryAdapter extends SocketIoAdapter {

    @Override
    public String[] listClientRooms(SocketIoSocket socket) throws IllegalArgumentException {
        if (socket == null) {
            throw new IllegalArgumentException("socket must not be null.");
        }

        if (mSocketRooms.containsKey(socket.getId())) {
            return mSocketRooms.get(socket.getId()).toArray(new String[0]);
        } else {
            return new String[0];
        }
    }

}

class SocketIoMemoryAdapterTest {

    private static final SocketIoMemoryAdapter.AdapterFactory ADAPTER_FACTORY;

    @Test
    public void test_listClientRooms_unknown_socket() {

        final SocketIoAdapter adapter = ADAPTER_FACTORY.createAdapter(null);

        final SocketIoSocket socket1 = createDummySocket();
        final SocketIoSocket socket2 = createDummySocket();

        assertEquals(0, adapter.listClientRooms(socket1).length);
        assertEquals(0, adapter.listClientRooms(socket2).length);
    }

}