@Test public void testIterator() { ClientsByEventProcessor testSubject = new ClientsByEventProcessor(blue1, "context", clientProcessors); Iterator<String> iterator = testSubject.iterator(); assertEquals(CLIENT_A, iterator.next()); assertEquals(CLIENT_B, iterator.next()); assertFalse(iterator.hasNext()); ClientsByEventProcessor testSubject2 = new ClientsByEventProcessor(red2, "anotherContext2", clientProcessors); Iterator<String> iterator2 = testSubject2.iterator(); assertFalse(iterator2.hasNext()); ClientsByEventProcessor testSubject3 = new ClientsByEventProcessor(green2, "context", clientProcessors); Iterator<String> iterator3 = testSubject3.iterator(); assertEquals(CLIENT_D, iterator3.next()); assertEquals(CLIENT_E, iterator3.next()); assertFalse(iterator3.hasNext()); }
@NotNull @Override public Iterator<String> iterator() { return stream(eventProcessors.spliterator(), false) .map(ClientProcessor::clientId) .iterator(); }
ClientsByEventProcessor implements Iterable<String> { @NotNull @Override public Iterator<String> iterator() { return stream(eventProcessors.spliterator(), false) .map(ClientProcessor::clientId) .iterator(); } }
ClientsByEventProcessor implements Iterable<String> { @NotNull @Override public Iterator<String> iterator() { return stream(eventProcessors.spliterator(), false) .map(ClientProcessor::clientId) .iterator(); } ClientsByEventProcessor(EventProcessorIdentifier processorId,
                                   String context,
                                   ClientProcessors allClientProcessors);  ClientsByEventProcessor(ClientProcessors eventProcessors); }
ClientsByEventProcessor implements Iterable<String> { @NotNull @Override public Iterator<String> iterator() { return stream(eventProcessors.spliterator(), false) .map(ClientProcessor::clientId) .iterator(); } ClientsByEventProcessor(EventProcessorIdentifier processorId,
                                   String context,
                                   ClientProcessors allClientProcessors);  ClientsByEventProcessor(ClientProcessors eventProcessors); @NotNull @Override Iterator<String> iterator(); }
ClientsByEventProcessor implements Iterable<String> { @NotNull @Override public Iterator<String> iterator() { return stream(eventProcessors.spliterator(), false) .map(ClientProcessor::clientId) .iterator(); } ClientsByEventProcessor(EventProcessorIdentifier processorId,
                                   String context,
                                   ClientProcessors allClientProcessors);  ClientsByEventProcessor(ClientProcessors eventProcessors); @NotNull @Override Iterator<String> iterator();  }