### Question:
RouteServiceImpl implements RouteService { @Override public Response getAllRoutes(HttpHeaders headers) { ArrayList<Route> routes = routeRepository.findAll(); if (routes != null && !routes.isEmpty()) { return new Response<>(1, success, routes); } else { return new Response<>(0, "No Content", null); } }  @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 testGetAllRoutes1() { ArrayList<Route> routes = new ArrayList<>(); routes.add(new Route()); Mockito.when(routeRepository.findAll()).thenReturn(routes); Response result = routeServiceImpl.getAllRoutes(headers); Assert.assertEquals("Success", result.getMsg()); }
@Test public void testGetAllRoutes2() { Mockito.when(routeRepository.findAll()).thenReturn(null); Response result = routeServiceImpl.getAllRoutes(headers); Assert.assertEquals("No Content", result.getMsg()); }