Skip to content

Instantly share code, notes, and snippets.

@anitaa1990
Created August 19, 2018 05:50
Show Gist options
  • Save anitaa1990/aa053d4e511769fefd2ca5b98369f1f3 to your computer and use it in GitHub Desktop.
Save anitaa1990/aa053d4e511769fefd2ca5b98369f1f3 to your computer and use it in GitHub Desktop.
@Test
public void testSkipLastObservable() throws InterruptedException {
Observable.just("A", "B", "C", "D", "E", "F", "G", "H", "I", "J")
.skipLast(4)
.subscribe(new Observer<String>() {
@Override
public void onSubscribe(Disposable d) {
}
@Override
public void onNext(String s) {
System.out.println("onNext: " + s);
}
@Override
public void onError(Throwable e) {
}
@Override
public void onComplete() {
}
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment