### Question:
AbstractIngestionHandler implements Handler<T, O>, BatchJobStage { @Override public O handle(T item, AbstractMessageReport report, ReportStats reportStats) { return handle(item, report, reportStats, new FileProcessStatus()); }  @Override O handle(T item, AbstractMessageReport report, ReportStats reportStats); O handle(T item, AbstractMessageReport report, ReportStats reportStats, FileProcessStatus fileProcessStatus); @Override List<O> handle(List<T> items, AbstractMessageReport report, ReportStats reportStats); List<O> handle(List<T> items, AbstractMessageReport report, ReportStats reportStats,
            FileProcessStatus fileProcessStatus); void setPreValidators(List<Validator<T>> preValidators); void setPostValidators(List<Validator<T>> postValidators);  }### Answer:
@SuppressWarnings("unchecked") @Test public void handleTest() { handler = Mockito.mock(AbstractIngestionHandler.class); Mockito.doCallRealMethod() .when(handler) .handle(Mockito.any(Resource.class), Mockito.any(AbstractMessageReport.class), Mockito.any(ReportStats.class)); Mockito.doCallRealMethod() .when(handler) .handle(Mockito.any(Resource.class), Mockito.any(AbstractMessageReport.class), Mockito.any(ReportStats.class), Mockito.any(FileProcessStatus.class)); Mockito.doCallRealMethod().when(handler) .pre(Mockito.any(Resource.class), Mockito.any(AbstractMessageReport.class), Mockito.any(ReportStats.class)); Mockito.doCallRealMethod().when(handler) .post(Mockito.any(Resource.class), Mockito.any(AbstractMessageReport.class), Mockito.any(ReportStats.class)); Mockito.doCallRealMethod().when(handler).setPreValidators(Mockito.anyList()); Mockito.doCallRealMethod().when(handler).setPostValidators(Mockito.anyList()); Validator<Resource> preValidator = Mockito.mock(Validator.class); Mockito.when( preValidator.isValid(Mockito.any(Resource.class), Mockito.any(AbstractMessageReport.class), Mockito.any(ReportStats.class), Mockito.any(Source.class), Mockito.any(Map.class))).thenReturn(true); List<Validator<Resource>> preValidators = new ArrayList<Validator<Resource>>(); preValidators.add(preValidator); handler.setPreValidators(preValidators); Validator<Resource> postValidator = Mockito.mock(Validator.class); Mockito.when( postValidator.isValid(Mockito.any(Resource.class), Mockito.any(AbstractMessageReport.class), Mockito.any(ReportStats.class), Mockito.any(Source.class), Mockito.any(Map.class))).thenReturn(true); List<Validator<Resource>> postValidators = new ArrayList<Validator<Resource>>(); postValidators.add(postValidator); handler.setPostValidators(postValidators); Resource ife = Mockito.mock(Resource.class); Mockito.when( handler.doHandling(Mockito.any(Resource.class), Mockito.any(AbstractMessageReport.class), Mockito.any(ReportStats.class), Mockito.any(FileProcessStatus.class))).thenReturn(ife); AbstractMessageReport report = Mockito.mock(AbstractMessageReport.class); ReportStats reportStats = Mockito.mock(ReportStats.class); Object fileEntry = null; fileEntry = handler.handle(ife, report, reportStats); Assert.assertNotNull(fileEntry); }