CustomProcessorsCollector { public LinkedList<FieldPostProcessor> getLowPriorityFieldPostProcessors() { LinkedList<FieldPostProcessor> result = new LinkedList<FieldPostProcessor>(); result.addAll(sortAndGetNegativePostProcessors(toList(priorityCustomFieldPostProcessors))); return result; }  LinkedList<FieldProcessor> getFieldProcessors(); LinkedList<FieldPostProcessor> getHighPriorityFieldPostProcessors(); LinkedList<FieldPostProcessor> getLowPriorityFieldPostProcessors();  }
@Test public void getLowPriorityFieldPostProcessors_noCustomProcessors_returnsEmptyList() throws Exception { noProcessors(); LinkedList<FieldPostProcessor> actualResult = testedObject.getLowPriorityFieldPostProcessors(); assertThat(actualResult).isEmpty(); }
@Test public void getLowPriorityFieldPostProcessors_customProcessorsSet_returnsOnlyLowPriorityProcessorsSortedAccordingToPriority() throws Exception { PriorityFieldPostProcessor veryLowPriorityProcessor = stubPriorityPostProcessor(-2); PriorityFieldPostProcessor lowPriorityProcessor = stubPriorityPostProcessor(-1); PriorityFieldPostProcessor highPriorityProcessor = stubPriorityPostProcessor(1); setPriorityPostProcessors(veryLowPriorityProcessor, lowPriorityProcessor, highPriorityProcessor); LinkedList<FieldPostProcessor> expectedResult = asList(lowPriorityProcessor, veryLowPriorityProcessor); LinkedList<FieldPostProcessor> actualResult = testedObject.getLowPriorityFieldPostProcessors(); assertThat(actualResult).isEqualTo(expectedResult); }