Suppose I have
private String userId;
private String email;
private AWSRegion region;
private String total;
List<Prop> all = new ArrayList<>
all.add(new Prop("aaa", "dddd", "EU", total1));
all.add(new Prop("aaa1", "dddd", "US", tota2l));
all.add(new Prop("aaa2", "dddd", "AU", tota2l));
all.add(new Prop("aaa3", "dddd", "AU", tota3l));
all.add(new Prop("aaa3", "dddd", "EU", tota4l));....a lot of regions
I want in one line java8 to have list of lists by property "AWSRegion"
some think like....but not to run it as "filter predicate" because I have many of regions...
List<Prop> users = all.stream().filter(u -> u.getRegeion() == AWSRegion.ASIA_SIDNEY).collect(Collectors.toList());
RESULT should be list of lists:
LIST : {sublist1-AU , sublist2-US, sublist3-EU....,etc'}
thanks,