QueueDrainHelper { public static void request(Subscription s, int prefetch) { s.request(prefetch < 0 ? Long.MAX_VALUE : prefetch); } private  QueueDrainHelper(); static void drainMaxLoop(SimplePlainQueue<T> q, Subscriber<? super U> a, boolean delayError,
            Disposable dispose, QueueDrain<T, U> qd); static boolean checkTerminated(boolean d, boolean empty,
            Subscriber<?> s, boolean delayError, SimpleQueue<?> q, QueueDrain<T, U> qd); static void drainLoop(SimplePlainQueue<T> q, Observer<? super U> a, boolean delayError, Disposable dispose, ObservableQueueDrain<T, U> qd); static boolean checkTerminated(boolean d, boolean empty,
            Observer<?> s, boolean delayError, SimpleQueue<?> q, Disposable disposable, ObservableQueueDrain<T, U> qd); static SimpleQueue<T> createQueue(int capacityHint); static void request(Subscription s, int prefetch); static boolean postCompleteRequest(long n,
                                                  Subscriber<? super T> actual,
                                                  Queue<T> queue,
                                                  AtomicLong state,
                                                  BooleanSupplier isCancelled); static void postComplete(Subscriber<? super T> actual,
                                        Queue<T> queue,
                                        AtomicLong state,
                                        BooleanSupplier isCancelled);  }
@Test public void requestMaxInt() { QueueDrainHelper.request(new Subscription() { @Override public void request(long n) { assertEquals(Integer.MAX_VALUE, n); } @Override public void cancel() { } }, Integer.MAX_VALUE); }
@Test public void requestMinInt() { QueueDrainHelper.request(new Subscription() { @Override public void request(long n) { assertEquals(Long.MAX_VALUE, n); } @Override public void cancel() { } }, Integer.MIN_VALUE); }
@Test public void requestAlmostMaxInt() { QueueDrainHelper.request(new Subscription() { @Override public void request(long n) { assertEquals(Integer.MAX_VALUE - 1, n); } @Override public void cancel() { } }, Integer.MAX_VALUE - 1); }