### Question:
FoodMapServiceImpl implements FoodMapService { @Override public Response listTrainFoodByTripId(String tripId, HttpHeaders headers) { List<TrainFood> trainFoodList = trainFoodRepository.findByTripId(tripId); if (trainFoodList != null) { return new Response<>(1, success, trainFoodList); } else { return new Response<>(0, noContent, null); } }  @Override Response createFoodStore(FoodStore fs, HttpHeaders headers); @Override TrainFood createTrainFood(TrainFood tf, HttpHeaders headers); @Override Response listFoodStores(HttpHeaders headers); @Override Response listTrainFood(HttpHeaders headers); @Override Response listFoodStoresByStationId(String stationId, HttpHeaders headers); @Override Response listTrainFoodByTripId(String tripId, HttpHeaders headers); @Override Response getFoodStoresByStationIds(List<String> stationIds);  }### Answer:
@Test public void testListTrainFoodByTripId1() { List<TrainFood> trainFoodList = new ArrayList<>(); trainFoodList.add(new TrainFood()); Mockito.when(trainFoodRepository.findByTripId(Mockito.anyString())).thenReturn(trainFoodList); Response result = foodMapServiceImpl.listTrainFoodByTripId("trip_id", headers); Assert.assertEquals(new Response<>(1, "Success", trainFoodList), result); }
@Test public void testListTrainFoodByTripId2() { Mockito.when(trainFoodRepository.findByTripId(Mockito.anyString())).thenReturn(null); Response result = foodMapServiceImpl.listTrainFoodByTripId("trip_id", headers); Assert.assertEquals(new Response<>(0, "No content", null), result); }