@Test void testCanHandleCallsCanHandleOnTheFirstDelegateToReturn() { testSubject.canHandle(testEventMessage, testSegment); verify(mockedEventHandlerInvokerOne).canHandle(testEventMessage, testSegment); verifyZeroInteractions(mockedEventHandlerInvokerTwo); }
@Override public boolean canHandle(EventMessage<?> eventMessage, Segment segment) { return delegates.stream().anyMatch(i -> canHandle(i, eventMessage, segment)); }
MultiEventHandlerInvoker implements EventHandlerInvoker { @Override public boolean canHandle(EventMessage<?> eventMessage, Segment segment) { return delegates.stream().anyMatch(i -> canHandle(i, eventMessage, segment)); } }
MultiEventHandlerInvoker implements EventHandlerInvoker { @Override public boolean canHandle(EventMessage<?> eventMessage, Segment segment) { return delegates.stream().anyMatch(i -> canHandle(i, eventMessage, segment)); } MultiEventHandlerInvoker(EventHandlerInvoker... delegates);  MultiEventHandlerInvoker(List<EventHandlerInvoker> delegates); }
MultiEventHandlerInvoker implements EventHandlerInvoker { @Override public boolean canHandle(EventMessage<?> eventMessage, Segment segment) { return delegates.stream().anyMatch(i -> canHandle(i, eventMessage, segment)); } MultiEventHandlerInvoker(EventHandlerInvoker... delegates);  MultiEventHandlerInvoker(List<EventHandlerInvoker> delegates); List<EventHandlerInvoker> delegates(); @Override boolean canHandle(EventMessage<?> eventMessage, Segment segment); @Override boolean canHandleType(Class<?> payloadType); @Override void handle(EventMessage<?> message, Segment segment); @Override boolean supportsReset(); @Override void performReset(); @Override void performReset(R resetContext); }
MultiEventHandlerInvoker implements EventHandlerInvoker { @Override public boolean canHandle(EventMessage<?> eventMessage, Segment segment) { return delegates.stream().anyMatch(i -> canHandle(i, eventMessage, segment)); } MultiEventHandlerInvoker(EventHandlerInvoker... delegates);  MultiEventHandlerInvoker(List<EventHandlerInvoker> delegates); List<EventHandlerInvoker> delegates(); @Override boolean canHandle(EventMessage<?> eventMessage, Segment segment); @Override boolean canHandleType(Class<?> payloadType); @Override void handle(EventMessage<?> message, Segment segment); @Override boolean supportsReset(); @Override void performReset(); @Override void performReset(R resetContext);  }