Skip to content

Instantly share code, notes, and snippets.

@nsk-mironov
Created June 14, 2015 18:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nsk-mironov/e13fe46938bf887f174a to your computer and use it in GitHub Desktop.
Save nsk-mironov/e13fe46938bf887f174a to your computer and use it in GitHub Desktop.
public class Main {
public static void main(final String[] args) throws Exception {
Observable.from(Arrays.asList(0, 1, 2, 3, 4, 5, 6, 7, 8, 10, 11, 12))
.groupBy(item -> item % 4)
.flatMap(Observable::toList)
.filter(integers -> integers.size() > 2)
.toList()
.subscribe(result -> {
System.out.printf("%d results %s%n", result.size(), result);
});
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment