### Question:
ServerLobby { public synchronized void addLobbyStateListener(ServerLobbyListener listener) { if(listener == null) return; if(!listeners.contains(listener)) { listeners.add(listener); } } ServerLobby(String serverName, int maxRobots, int maxUsers); synchronized void addLobbyStateListener(ServerLobbyListener listener); synchronized void removeLobbyStateListener(ServerLobbyListener listener); synchronized boolean addUserProxy(UserProxy userProxy); synchronized void removeUserProxy(UserProxy userProxy); synchronized boolean registerRobot(RobotProxy robot); synchronized void unregisterRobot(RobotProxy robot); synchronized void broadcastMessage(String message); synchronized void broadcastUserStateUpdate(UserProxy userProxy); synchronized void setGameType(GameType newType); boolean gameInProgress(); GameController getCurrentGame(); GameType getCurrentGameType(); synchronized RobotProxy getRobotProxy(String identifier); synchronized boolean isUsernameRegistered(String username); String getServerName(); synchronized void launchGame(); synchronized void endCurrentGame();  }### Answer:
@Test public void testAddLobbyStateListener() { TestLobbyListener testAdd = new TestLobbyListener(); testLobby.addLobbyStateListener(testAdd); testLobby.addLobbyStateListener(testAdd); testLobby.addLobbyStateListener(null); testLobby.broadcastMessage("Test Chat"); assertEquals("Test Chat", testAdd.getLastChatEvent().getMessage()); assertEquals(1, testAdd.getNumEvents()); testLobby.removeLobbyStateListener(testAdd); }