### Question:
StatisticsAccessor { public String getStatistics() { WebTarget target = client.target(restUrl + "/" + StatisticsOptionListContainer.STATISTICS); Response response = target.request(MediaType.APPLICATION_JSON).get(); if (response.getStatus() == 500) { Result errorMessage = response.readEntity(Result.class); LOGGER.warn("getStatistics(..) failure! : " + errorMessage.getResult()); throw new InternalServerErrorException(errorMessage.getResult()); } Result result = response.readEntity(Result.class); LOGGER.info("getStatistics(..) success!"); return result.getResult(); } StatisticsAccessor(URL restUrl, String username, String password);   StatisticsAccessor(URL restUrl, String username, String password, Client client); String getStatistics();  }### Answer:
@Test public void testGetStatistics() throws DoesNotExistException { Mockito.when(response.getStatus()).thenReturn(200); Mockito.when(response.readEntity(String.class)).thenReturn(new String("Success!!S")); String statistics = sa.getStatistics(); Assert.assertNotNull(statistics); }
@Test(expected = InternalServerErrorException.class) public void testGetDatasetDoesNotExist() throws InternalServerErrorException { Mockito.when(response.getStatus()).thenReturn(500); Mockito.when(response.readEntity(Result.class)).thenReturn(new Result("Internal Server Error!")); sa.getStatistics(); }