### Question:
TrainServiceImpl implements TrainService { @Override public List<TrainType> query(HttpHeaders headers) { return repository.findAll(); }  @Override boolean create(TrainType trainType, HttpHeaders headers); @Override TrainType retrieve(String id, HttpHeaders headers); @Override boolean update(TrainType trainType, HttpHeaders headers); @Override boolean delete(String id, HttpHeaders headers); @Override List<TrainType> query(HttpHeaders headers);  }### Answer:
@Test public void testQuery() { Mockito.when(repository.findAll()).thenReturn(null); Assert.assertNull(trainServiceImpl.query(headers)); }