Skip to content

Instantly share code, notes, and snippets.

@juankg214
Created June 9, 2021 03:30
Show Gist options
  • Save juankg214/a340b74659748cd55f194b67092ea6d6 to your computer and use it in GitHub Desktop.
Save juankg214/a340b74659748cd55f194b67092ea6d6 to your computer and use it in GitHub Desktop.
String[] letters = {"a", "b", "c", "d", "e", "f", "g"};
Observable<String> observable = Observable.from(letters);
observable.subscribe(
i -> result += i, //OnNext
Throwable::printStackTrace, //OnError
() -> result += "_Completed" //OnCompleted
);
assertTrue(result.equals("abcdefg_Completed"));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment