@Test
public void requestZero() {

    final List<Object> list = new ArrayList<Object>();
    Subscriber<Object> sub = new Subscriber<Object>() {
        @Override
        public void onSubscribe(Subscription s) {
            s.request(0);
        }
        @Override
        public void onNext(Object t) {
            list.add(t);
        }
        @Override
        public void onError(Throwable t) {
            list.add(t);
        }
        @Override
        public void onComplete() {
            list.add("Done");
        }
    };
    Flowable.range(1, 5).subscribe(sub);
    assertTrue(list.toString(), list.get(0) instanceof IllegalArgumentException);
    assertTrue(list.toString(), list.get(0).toString().contains("3.9"));
}