@Test public void testAllResolved() throws Exception { final StreamCollectHelper<Object, Object> helper = new StreamCollectHelper<>(caller, 2, consumer, supplier, target); when(supplier.get()).thenReturn(transformed); helper.completed(result); verify(caller).execute(any(Runnable.class)); verify(target, never()).complete(transformed); helper.completed(result); verify(supplier).get(); verify(target).complete(transformed); }
@Override public void completed(S result) { successful.incrementAndGet(); caller.execute(() -> consumer.accept(result)); check(); }
StreamCollectHelper implements Handle<S> { @Override public void completed(S result) { successful.incrementAndGet(); caller.execute(() -> consumer.accept(result)); check(); } }
StreamCollectHelper implements Handle<S> { @Override public void completed(S result) { successful.incrementAndGet(); caller.execute(() -> consumer.accept(result)); check(); } StreamCollectHelper(
      final Caller caller, final int size, final Consumer<S> consumer, final Supplier<T> supplier,
      final Completable<? super T> target
  ); }
StreamCollectHelper implements Handle<S> { @Override public void completed(S result) { successful.incrementAndGet(); caller.execute(() -> consumer.accept(result)); check(); } StreamCollectHelper(
      final Caller caller, final int size, final Consumer<S> consumer, final Supplier<T> supplier,
      final Completable<? super T> target
  ); @Override void failed(Throwable e); @Override void completed(S result); @Override void cancelled(); }
StreamCollectHelper implements Handle<S> { @Override public void completed(S result) { successful.incrementAndGet(); caller.execute(() -> consumer.accept(result)); check(); } StreamCollectHelper(
      final Caller caller, final int size, final Consumer<S> consumer, final Supplier<T> supplier,
      final Completable<? super T> target
  ); @Override void failed(Throwable e); @Override void completed(S result); @Override void cancelled();  }