### Question:
Travel2ServiceImpl implements Travel2Service { @Override public Response getTripByRoute(ArrayList<String> routeIds, HttpHeaders headers) { ArrayList<ArrayList<Trip>> tripList = new ArrayList<>(); for (String routeId : routeIds) { ArrayList<Trip> tempTripList = repository.findByRouteId(routeId); if (tempTripList == null) { tempTripList = new ArrayList<>(); } tripList.add(tempTripList); } if (!tripList.isEmpty()) { return new Response<>(1, success, tripList); } else { return new Response<>(0, noCnontent, null); } }  @Override Response getRouteByTripId(String tripId, HttpHeaders headers); @Override Response getTrainTypeByTripId(String tripId, HttpHeaders headers); @Override Response getTripByRoute(ArrayList<String> routeIds, HttpHeaders headers); @Override Response create(TravelInfo info, HttpHeaders headers); @Override Response retrieve(String tripId, HttpHeaders headers); @Override Response update(TravelInfo info, HttpHeaders headers); @Override Response delete(String tripId, HttpHeaders headers); @Override Response query(TripInfo info, HttpHeaders headers); @Override Response getTripAllDetailInfo(TripAllDetailInfo gtdi, HttpHeaders headers); @Override Response queryAll(HttpHeaders headers); @Override Response adminQueryAll(HttpHeaders headers);  }### Answer:
@Test public void testGetTripByRoute1() { ArrayList<String> routeIds = new ArrayList<>(); Response result = travel2ServiceImpl.getTripByRoute(routeIds, headers); Assert.assertEquals(new Response<>(0, noCnontent, null), result); }
@Test public void testGetTripByRoute2() { ArrayList<String> routeIds = new ArrayList<>(); routeIds.add("route_id_1"); Mockito.when(repository.findByRouteId(Mockito.anyString())).thenReturn(null); Response result = travel2ServiceImpl.getTripByRoute(routeIds, headers); Assert.assertEquals(success, result.getMsg()); }