I have a list of Student
:
Observable<Student> source = Observable.fromIterable(getStudentList());
I would like to group them by postal code, along with how many times they appear, but the problem is that I use java 7
how to do this?
I have a list of Student
:
Observable<Student> source = Observable.fromIterable(getStudentList());
I would like to group them by postal code, along with how many times they appear, but the problem is that I use java 7
how to do this?
Use
groupBy
,flatMap
andcount
on the groups themselves:Without lambdas it looks more ugly though: