### Question:
ServerLobby { public synchronized void unregisterRobot(RobotProxy robot) { if(robots.remove(robot)) { log.debug("Robot: " + robot.getIdentifier() + " removed from lobby."); for(ServerLobbyListener listener : listeners) { listener.robotStateChanged(new LobbyRobotEvent(this, ServerLobbyEvent.EVENT_ROBOT_UNREGISTERED, robot)); } if(currentGame != null) { if(currentGame.isActiveRobot(robot)) { log.info("Active robot left a game, triggering termination."); currentGame.triggerTermination(); } } } } 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 testUnregisterRobot() { RobotProxy testRobot = new TestRobotProxy(testLobby, "RegisteredRobot"); RobotProxy testRobot2 = new TestRobotProxy(testLobby, "UnregisteredRobot"); testLobby.unregisterRobot(testRobot2); testListener.clearNumEvents(); testLobby.removeUserProxy(null); assertEquals(0, testListener.getNumEvents()); testLobby.unregisterRobot(testRobot2); assertEquals(0, testListener.getNumEvents()); testLobby.unregisterRobot(testRobot); assertEquals(testRobot, testListener.getLastRobotEvent().getRobot()); assertEquals(ServerLobbyEvent.EVENT_ROBOT_UNREGISTERED, testListener.getLastRobotEvent().getEventType()); }