Skip to content

Instantly share code, notes, and snippets.

@jwkidd3
Created January 18, 2017 22:02
Show Gist options
  • Save jwkidd3/b25ff5f67cc1e886f8c5fa77644482d0 to your computer and use it in GitHub Desktop.
Save jwkidd3/b25ff5f67cc1e886f8c5fa77644482d0 to your computer and use it in GitHub Desktop.
Observable<String> values = Observable.just(
"first",
"second",
"third",
"forth",
"fifth",
"sixth"
);
values.groupBy(word -> word.charAt(0))
.subscribe(
group -> group.last()
.subscribe(v -> System.out.println(group.getKey() + ": " + v))
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment