### Question:
MediaStreamer implements ServerLobbyListener, CaptureObserver { public List<CameraController> getAvailableCameras() { return cameras; } MediaStreamer(int port); int getPort(); synchronized void updateDeviceList(); CameraController getActiveCamera(); synchronized void playStream(); synchronized void setObserver(CaptureObserver observer); synchronized void stopStream(); void setActiveCamera(CameraController newCam); List<CameraController> getAvailableCameras(); boolean isStreaming(); boolean addUser(User user); boolean removeUser(User user); boolean isServingUser(User user); int getNumUsers(); @Override /** * Starts and stops the network video stream when a game is launched * or terminated. */ void lobbyGameStateChanged(LobbyGameEvent event); @Override /** * Adds and removes users from the streaming media client list when a user * joins or leaves the server lobby. */ void userStateChanged(LobbyUserEvent event); @Override void robotStateChanged(LobbyRobotEvent event); @Override void lobbyChatMessage(LobbyChatEvent event); @Override /** Logs errors in the capture stream */ void onError(CaptureStream stream, CaptureException err); @Override /** Called whenever a new frame is read from the active capture stream */ void onNewImage(CaptureStream stream, Image image); static boolean ENABLE_TEST_CLIENT; static String TEST_CLIENT_HOSTNAME; static long IMAGE_WRITE_INTERVAL; static int VIDEO_WIDTH; static int VIDEO_HEIGHT; static int INC_BUFFER_SIZE; static int PACKET_SIZE; }### Answer:
@Test public void testGetAvailableCameras() { testMedia.updateDeviceList(); CameraController activeCam = testMedia.getActiveCamera(); List<CameraController> camList = testMedia.getAvailableCameras(); assertEquals(true, camList.contains(activeCam)); }