ImplementationUtils { public static Implementation findImplementationForExecutor(Collection<Implementation> implementations, String executor) { for (Implementation implementation : implementations) { if (implementation.isExecutor(executor)) { return implementation; } } return null; } private  ImplementationUtils(); static void mapForProduct(Implementation implementation, String productName,
                                     ImplementationReportViewModel report); static Treatment findTreatmentForProduct(Collection<Treatment> treatments, String productCode); static Implementation findImplementationForExecutor(Collection<Implementation> implementations, String executor); static final String CURRENT_TREATMENT_SETTER; static final String EXISTING_STOCK_SETTER; }
@Test public void shouldReturnNullWhenImplementationIsNotFoundByExecutor() { Implementation implementationForExecutor = ImplementationUtils.findImplementationForExecutor(implementations, emptyString); assertThat(implementationForExecutor, is(nullValue())); }
@Test public void shouldFindImplementationByExecutor() { Implementation implementationForExecutor = ImplementationUtils.findImplementationForExecutor(implementations, US); assertThat(implementationForExecutor.getExecutor(), is(implementation.getExecutor())); }