### Question:
CandidateProcessor { Collection<IntArrayPair> getRecommendations() { return violationHandler.pollViolations(); }    }### Answer:
@Test public void testGetRecommendations() { CandidateProcessor processor = createProcessor(); Collection<Candidate> candidates = Collections.singletonList(Mockito.mock(Candidate.class)); ValidationResult validationResult = Mockito.mock(ValidationResult.class); Collection<AnalyzeTask> results = Collections .singletonList(new AnalyzeTask(validationResult, Mockito.mock(ThresholdLowerer.class))); RhsResult rhsResult = Mockito.mock(RhsResult.class); when(validationResult.getRhsResults()).thenReturn(Collections.singletonList(rhsResult)); IntArrayPair violation = Mockito.mock(IntArrayPair.class); when(rhsResult.getViolations()).thenReturn(Collections.singletonList(violation)); when(validator.validate(candidates)).thenReturn(results); when(analyzer.analyze(results)).thenReturn(Mockito.mock(Statistics.class)); processor.validateAndAnalyze(candidates); Collection<IntArrayPair> recommendations = processor.getRecommendations(); assertThat(recommendations).hasSize(1); assertThat(recommendations).contains(violation); }