QueueDrainSubscriber extends QueueDrainSubscriberPad4 implements FlowableSubscriber<T>, QueueDrain<U, V> { @Override public final boolean enter() { return wip.getAndIncrement() == 0; } QueueDrainSubscriber(Subscriber<? super V> actual, SimplePlainQueue<U> queue); @Override final boolean cancelled(); @Override final boolean done(); @Override final boolean enter(); final boolean fastEnter(); @Override boolean accept(Subscriber<? super V> a, U v); @Override final Throwable error(); @Override final int leave(int m); @Override final long requested(); @Override final long produced(long n); final void requested(long n);  }
@Test public void unorderedSlowPath() { TestSubscriber<Integer> ts = new TestSubscriber<Integer>(1); Disposable d = Disposables.empty(); QueueDrainSubscriber<Integer, Integer, Integer> qd = createUnordered(ts, d); ts.onSubscribe(new BooleanSubscription()); qd.enter(); qd.onNext(1); ts.assertEmpty(); }
@Test public void orderedSlowPath() { TestSubscriber<Integer> ts = new TestSubscriber<Integer>(1); Disposable d = Disposables.empty(); QueueDrainSubscriber<Integer, Integer, Integer> qd = createOrdered(ts, d); ts.onSubscribe(new BooleanSubscription()); qd.enter(); qd.onNext(1); ts.assertEmpty(); }