### Question:
StationServiceImpl implements StationService { @Override public Response create(Station station, HttpHeaders headers) { if (repository.findById(station.getId()) == null) { station.setStayTime(station.getStayTime()); repository.save(station); return new Response<>(1, "Create success", station); } return new Response<>(0, "Already exists", station); }  @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 testCreate1() { Station station = new Station(); Mockito.when(repository.findById(Mockito.anyString())).thenReturn(null); Mockito.when(repository.save(Mockito.any(Station.class))).thenReturn(null); Response result = stationServiceImpl.create(station, headers); Assert.assertEquals(new Response<>(1, "Create success", station), result); }
@Test public void testCreate2() { Station station = new Station(); Mockito.when(repository.findById(Mockito.anyString())).thenReturn(station); Response result = stationServiceImpl.create(station, headers); Assert.assertEquals(new Response<>(0, "Already exists", station), result); }