### Question:
AuthClient extends Client { public LoginTracker getLoginTracker() { return loginTracker; } AuthClient(MessageIO messageIO, ClientUser user); static Message generateLogoutRequest(); static Message generateLoginRequest(ClientUser user); LoginTracker getLoginTracker(); ClientUser getUser();  }### Answer:
@Test public void testIsLoggedIn() { MessageInputStream mis = mock(MessageInputStream.class); MessageOutputStream mos = mock(MessageOutputStream.class); MessageIO messageIO = new MessageIO(mis, mos); ClientUser clientUser = mock(ClientUser.class); boolean random = ((Math.random() * 10) % 2) == 0; AuthClient authClient = new AuthClient(messageIO, clientUser); authClient.getLoginTracker().setLoggedIn(random); Assert.assertEquals(authClient.getLoginTracker().isLoggedIn(), random, "Login status was not expected."); }
@Test public void testLoggedInTime() { MessageInputStream mis = mock(MessageInputStream.class); MessageOutputStream mos = mock(MessageOutputStream.class); MessageIO messageIO = new MessageIO(mis, mos); ClientUser clientUser = mock(ClientUser.class); long random = (long) (Math.random() * 1000); AuthClient authClient = new AuthClient(messageIO, clientUser); authClient.getLoginTracker().setLoggedInTime(random); Assert.assertEquals(authClient.getLoginTracker().getLoggedInTime(), random, "Login time was incorrect."); }