### Question:
RoutePlanServiceImpl implements RoutePlanService { @Override public Response searchQuickestResult(RoutePlanInfo info, HttpHeaders headers) { TripInfo queryInfo = new TripInfo(); queryInfo.setStartingPlace(info.getFormStationName()); queryInfo.setEndPlace(info.getToStationName()); queryInfo.setDepartureTime(info.getTravelDate()); ArrayList<TripResponse> highSpeed = getTripFromHighSpeedTravelServive(queryInfo, headers); ArrayList<TripResponse> normalTrain = getTripFromNormalTrainTravelService(queryInfo, headers); ArrayList<TripResponse> finalResult = new ArrayList<>(); for (TripResponse tr : highSpeed) { finalResult.add(tr); } for (TripResponse tr : normalTrain) { finalResult.add(tr); } long minTime; int minIndex = -1; int size = Math.min(finalResult.size(), 5); ArrayList<TripResponse> returnResult = new ArrayList<>(); for (int i = 0; i < size; i++) { minTime = Long.MAX_VALUE; for (int j = 0; j < finalResult.size(); j++) { TripResponse thisRes = finalResult.get(j); if (thisRes.getEndTime().getTime() - thisRes.getStartingTime().getTime() < minTime) { minTime = thisRes.getEndTime().getTime() - thisRes.getStartingTime().getTime(); minIndex = j; } } returnResult.add(finalResult.get(minIndex)); finalResult.remove(minIndex); } ArrayList<RoutePlanResultUnit> units = new ArrayList<>(); for (int i = 0; i < returnResult.size(); i++) { TripResponse tempResponse = returnResult.get(i); RoutePlanResultUnit tempUnit = new RoutePlanResultUnit(); tempUnit.setTripId(tempResponse.getTripId().toString()); tempUnit.setTrainTypeId(tempResponse.getTrainTypeId()); tempUnit.setFromStationName(tempResponse.getStartingStation()); tempUnit.setToStationName(tempResponse.getTerminalStation()); tempUnit.setStopStations(getStationList(tempResponse.getTripId().toString(), headers)); tempUnit.setPriceForSecondClassSeat(tempResponse.getPriceForEconomyClass()); tempUnit.setPriceForFirstClassSeat(tempResponse.getPriceForConfortClass()); tempUnit.setStartingTime(tempResponse.getStartingTime()); tempUnit.setEndTime(tempResponse.getEndTime()); units.add(tempUnit); } return new Response<>(1, "Success", units); }  @Override Response searchCheapestResult(RoutePlanInfo info, HttpHeaders headers); @Override Response searchQuickestResult(RoutePlanInfo info, HttpHeaders headers); @Override Response searchMinStopStations(RoutePlanInfo info, HttpHeaders headers);  }### Answer:
@Test public void testSearchQuickestResult() { RoutePlanInfo info = new RoutePlanInfo("form_station", "to_station", new Date(), 1); ArrayList<TripResponse> tripResponses = new ArrayList<>(); Response<ArrayList<TripResponse>> response1 = new Response<>(null, null, tripResponses); ResponseEntity<Response<ArrayList<TripResponse>>> re1 = new ResponseEntity<>(response1, HttpStatus.OK); Mockito.when(restTemplate.exchange( Mockito.anyString(), Mockito.any(HttpMethod.class), Mockito.any(HttpEntity.class), Mockito.any(ParameterizedTypeReference.class))) .thenReturn(re1); Response result = routePlanServiceImpl.searchQuickestResult(info, headers); Assert.assertEquals(new Response<>(1, "Success", new ArrayList<>()), result); }