@Test public void testWithListeners() { final List<Object> listeners = new ArrayList<>(); new SequentialExecution<Object>(new Kernel.Fake(new Status.Fake(), listeners)) .with(new Object()); MatcherAssert.assertThat(listeners, Matchers.hasSize(1)); }
@Override public Kernel<Listener> with(Listener... listeners) { return new SequentialExecution<>( this.elements.stream() .map(listenerKernel -> listenerKernel.with(listeners)) .collect(Collectors.toList())); }
SequentialExecution implements Kernel<Listener> { @Override public Kernel<Listener> with(Listener... listeners) { return new SequentialExecution<>( this.elements.stream() .map(listenerKernel -> listenerKernel.with(listeners)) .collect(Collectors.toList())); } }
SequentialExecution implements Kernel<Listener> { @Override public Kernel<Listener> with(Listener... listeners) { return new SequentialExecution<>( this.elements.stream() .map(listenerKernel -> listenerKernel.with(listeners)) .collect(Collectors.toList())); } @SafeVarargs  SequentialExecution(Kernel<Listener>... kernels);  SequentialExecution(List<Kernel<Listener>> kernels); }
SequentialExecution implements Kernel<Listener> { @Override public Kernel<Listener> with(Listener... listeners) { return new SequentialExecution<>( this.elements.stream() .map(listenerKernel -> listenerKernel.with(listeners)) .collect(Collectors.toList())); } @SafeVarargs  SequentialExecution(Kernel<Listener>... kernels);  SequentialExecution(List<Kernel<Listener>> kernels); @Override Status status(); @Override Kernel<Listener> with(Listener... listeners); }
SequentialExecution implements Kernel<Listener> { @Override public Kernel<Listener> with(Listener... listeners) { return new SequentialExecution<>( this.elements.stream() .map(listenerKernel -> listenerKernel.with(listeners)) .collect(Collectors.toList())); } @SafeVarargs  SequentialExecution(Kernel<Listener>... kernels);  SequentialExecution(List<Kernel<Listener>> kernels); @Override Status status(); @Override Kernel<Listener> with(Listener... listeners);  }