@Test public void iterator() { ClientProcessorsByIdentifier testSubject = new ClientProcessorsByIdentifier(clientProcessors, "context", blue1); Iterator<ClientProcessor> iterator = testSubject.iterator(); assertEquals(blueA, iterator.next()); assertEquals(blueB, iterator.next()); assertFalse(iterator.hasNext()); ClientProcessorsByIdentifier testSubject2 = new ClientProcessorsByIdentifier(clientProcessors, "context", red1); Iterator<ClientProcessor> iterator2 = testSubject2.iterator(); assertEquals(redA, iterator2.next()); assertEquals(redB, iterator2.next()); assertFalse(iterator2.hasNext()); ClientProcessorsByIdentifier testSubject3 = new ClientProcessorsByIdentifier(clientProcessors, "context", green1); Iterator<ClientProcessor> iterator3 = testSubject3.iterator(); assertEquals(greenA, iterator3.next()); assertEquals(greenB, iterator3.next()); assertFalse(iterator3.hasNext()); ClientProcessorsByIdentifier testSubject4 = new ClientProcessorsByIdentifier(clientProcessors, "context", blue2); Iterator<ClientProcessor> iterator4 = testSubject4.iterator(); assertEquals(blueD, iterator4.next()); assertEquals(blueE, iterator4.next()); assertFalse(iterator4.hasNext()); ClientProcessorsByIdentifier testSubject5 = new ClientProcessorsByIdentifier(clientProcessors, "context", red2); Iterator<ClientProcessor> iterator5 = testSubject5.iterator(); assertEquals(redD, iterator5.next()); assertEquals(redE, iterator5.next()); assertFalse(iterator5.hasNext()); ClientProcessorsByIdentifier testSubject6 = new ClientProcessorsByIdentifier(clientProcessors, "context", green2); Iterator<ClientProcessor> iterator6 = testSubject6.iterator(); assertEquals(greenD, iterator6.next()); assertEquals(greenE, iterator6.next()); assertFalse(iterator6.hasNext()); }
@Nonnull @Override public Iterator<ClientProcessor> iterator() { return stream(allClientProcessors.spliterator(), false) .filter(sameEventProcessor) .iterator(); }
ClientProcessorsByIdentifier implements ClientProcessors { @Nonnull @Override public Iterator<ClientProcessor> iterator() { return stream(allClientProcessors.spliterator(), false) .filter(sameEventProcessor) .iterator(); } }
ClientProcessorsByIdentifier implements ClientProcessors { @Nonnull @Override public Iterator<ClientProcessor> iterator() { return stream(allClientProcessors.spliterator(), false) .filter(sameEventProcessor) .iterator(); } ClientProcessorsByIdentifier(
            ClientProcessors allClientProcessors,
            String context,
            EventProcessorIdentifier eventProcessorIdentifier);  ClientProcessorsByIdentifier(
            ClientProcessors allClientProcessors,
            Predicate<ClientProcessor> sameEventProcessor); }
ClientProcessorsByIdentifier implements ClientProcessors { @Nonnull @Override public Iterator<ClientProcessor> iterator() { return stream(allClientProcessors.spliterator(), false) .filter(sameEventProcessor) .iterator(); } ClientProcessorsByIdentifier(
            ClientProcessors allClientProcessors,
            String context,
            EventProcessorIdentifier eventProcessorIdentifier);  ClientProcessorsByIdentifier(
            ClientProcessors allClientProcessors,
            Predicate<ClientProcessor> sameEventProcessor); @Nonnull @Override Iterator<ClientProcessor> iterator(); }
ClientProcessorsByIdentifier implements ClientProcessors { @Nonnull @Override public Iterator<ClientProcessor> iterator() { return stream(allClientProcessors.spliterator(), false) .filter(sameEventProcessor) .iterator(); } ClientProcessorsByIdentifier(
            ClientProcessors allClientProcessors,
            String context,
            EventProcessorIdentifier eventProcessorIdentifier);  ClientProcessorsByIdentifier(
            ClientProcessors allClientProcessors,
            Predicate<ClientProcessor> sameEventProcessor); @Nonnull @Override Iterator<ClientProcessor> iterator();  }