### Question:
RouteServiceImpl implements RouteService { @Override public Response getRouteById(String routeId, HttpHeaders headers) { Route route = routeRepository.findById(routeId); if (route == null) { return new Response<>(0, "No content with the routeId", null); } else { return new Response<>(1, success, route); } }  @Override Response createAndModify(RouteInfo info, HttpHeaders headers); @Override Response deleteRoute(String routeId, HttpHeaders headers); @Override Response getRouteById(String routeId, HttpHeaders headers); @Override Response getRouteByStartAndTerminal(String startId, String terminalId, HttpHeaders headers); @Override Response getAllRoutes(HttpHeaders headers);  }### Answer:
@Test public void testGetRouteById1() { Mockito.when(routeRepository.findById(Mockito.anyString())).thenReturn(null); Response result = routeServiceImpl.getRouteById("route_id", headers); Assert.assertEquals(new Response<>(0, "No content with the routeId", null), result); }
@Test public void testGetRouteById2() { Route route = new Route(); Mockito.when(routeRepository.findById(Mockito.anyString())).thenReturn(route); Response result = routeServiceImpl.getRouteById("route_id", headers); Assert.assertEquals(new Response<>(1, "Success", route), result); }