@Test public void errorAfterSkip() { TestSubscriber<Object> ts = new TestSubscriber<>(); Multi.create(() -> new Iterator<Object>() { int count; @Override public boolean hasNext() { if (++count == 4) { throw new IllegalArgumentException(); } return true; } @Override public Object next() { return count; } }) .skip(2) .subscribe(ts); ts.requestMax(); assertEquals(ts.getItems(), Collections.singletonList(3)); assertThat(ts.getLastError(), instanceOf(IllegalArgumentException.class)); assertThat(ts.isComplete(), is(false)); }
@Override public void subscribe(Flow.Subscriber<? super T> subscriber) { Objects.requireNonNull(subscriber, "subscriber is null"); source.subscribe(new SkipSubscriber<>(subscriber, n)); }
MultiSkipPublisher implements Multi<T> { @Override public void subscribe(Flow.Subscriber<? super T> subscriber) { Objects.requireNonNull(subscriber, "subscriber is null"); source.subscribe(new SkipSubscriber<>(subscriber, n)); } }
MultiSkipPublisher implements Multi<T> { @Override public void subscribe(Flow.Subscriber<? super T> subscriber) { Objects.requireNonNull(subscriber, "subscriber is null"); source.subscribe(new SkipSubscriber<>(subscriber, n)); } MultiSkipPublisher(Multi<T> source, long n); }
MultiSkipPublisher implements Multi<T> { @Override public void subscribe(Flow.Subscriber<? super T> subscriber) { Objects.requireNonNull(subscriber, "subscriber is null"); source.subscribe(new SkipSubscriber<>(subscriber, n)); } MultiSkipPublisher(Multi<T> source, long n); @Override void subscribe(Flow.Subscriber<? super T> subscriber); }
MultiSkipPublisher implements Multi<T> { @Override public void subscribe(Flow.Subscriber<? super T> subscriber) { Objects.requireNonNull(subscriber, "subscriber is null"); source.subscribe(new SkipSubscriber<>(subscriber, n)); } MultiSkipPublisher(Multi<T> source, long n); @Override void subscribe(Flow.Subscriber<? super T> subscriber);  }