### Question:
MultiReduceFull extends CompletionSingle<R> { @Override public void subscribe(Flow.Subscriber<? super R> subscriber) { R initial; try { initial = Objects.requireNonNull(supplier.get(), "The supplier returned a null item"); } catch (Throwable ex) { subscriber.onSubscribe(EmptySubscription.INSTANCE); subscriber.onError(ex); return; } source.subscribe(new ReduceFullSubscriber<>(subscriber, initial, reducer)); } MultiReduceFull(Multi<T> source, Supplier<? extends R> supplier, BiFunction<R, T, R> reducer); @Override void subscribe(Flow.Subscriber<? super R> subscriber);  }### Answer:
@Test public void empty() { TestSubscriber<Object> ts = new TestSubscriber<>(Long.MAX_VALUE); Multi.<Integer>empty().reduce(() -> 100, Integer::sum) .subscribe(ts); ts.assertResult(100); }
@Test public void single() { TestSubscriber<Object> ts = new TestSubscriber<>(Long.MAX_VALUE); Multi.singleton(1).reduce(() -> 100, Integer::sum) .subscribe(ts); ts.assertResult(101); }
@Test public void range() { TestSubscriber<Object> ts = new TestSubscriber<>(Long.MAX_VALUE); Multi.range(1, 10).reduce(() -> 100, Integer::sum) .subscribe(ts); ts.assertResult(155); }
@Test public void error() { TestSubscriber<Object> ts = new TestSubscriber<>(); Multi.<Integer>error(new IOException()).reduce(() -> 100, Integer::sum) .subscribe(ts); ts.assertFailure(IOException.class); }
@Test public void supplierNull() { TestSubscriber<Object> ts = new TestSubscriber<>(); Multi.range(1, 5) .reduce(() -> null, Integer::sum) .subscribe(ts); ts.assertFailure(NullPointerException.class); }
@Test public void supplierCrash() { TestSubscriber<Object> ts = new TestSubscriber<>(); Multi.range(1, 5) .reduce(() -> { throw new IllegalArgumentException(); }, Integer::sum) .subscribe(ts); ts.assertFailure(IllegalArgumentException.class); }
@Test public void reducerNull() { TestSubscriber<Object> ts = new TestSubscriber<>(); Multi.range(1, 5) .reduce(() -> 100, (a, b) -> null) .subscribe(ts); ts.assertFailure(NullPointerException.class); }
@Test public void reducerCrash() { TestSubscriber<Object> ts = new TestSubscriber<>(); Multi.range(1, 5) .reduce(() -> 100, (a, b) -> { throw new IllegalArgumentException(); }) .subscribe(ts); ts.assertFailure(IllegalArgumentException.class); }
@Test public void cancel() { TestSubscriber<Object> ts = new TestSubscriber<>(); Multi.<Integer>never() .reduce(() -> 100, Integer::sum) .subscribe(ts); ts.cancel(); ts.assertEmpty(); }