### Question:
StationServiceImpl implements StationService { @Override public Response queryByIdBatch(List<String> idList, HttpHeaders headers) { ArrayList<String> result = new ArrayList<>(); for (int i = 0; i < idList.size(); i++) { Station station = repository.findById(idList.get(i)); if (station != null) { result.add(station.getName()); } } if (!result.isEmpty()) { return new Response<>(1, success, result); } else { return new Response<>(0, "No stationNamelist according to stationIdList", result); } }  @Override Response create(Station station, HttpHeaders headers); @Override boolean exist(String stationName, HttpHeaders headers); @Override Response update(Station info, HttpHeaders headers); @Override Response delete(Station info, HttpHeaders headers); @Override Response query(HttpHeaders headers); @Override Response queryForId(String stationName, HttpHeaders headers); @Override Response queryForIdBatch(List<String> nameList, HttpHeaders headers); @Override Response queryById(String stationId, HttpHeaders headers); @Override Response queryByIdBatch(List<String> idList, HttpHeaders headers);  }### Answer:
@Test public void testQueryByIdBatch1() { List<String> idList = new ArrayList<>(); Response result = stationServiceImpl.queryByIdBatch(idList, headers); Assert.assertEquals(new Response<>(0, "No stationNamelist according to stationIdList", new ArrayList<>()), result); }
@Test public void testQueryByIdBatch2() { Station station = new Station(); List<String> idList = new ArrayList<>(); idList.add("station_id"); Mockito.when(repository.findById(Mockito.anyString())).thenReturn(station); Response result = stationServiceImpl.queryByIdBatch(idList, headers); Assert.assertEquals("Success", result.getMsg()); }