I hava a list of Class A like
A
class A { private Integer keyA; private Integer keyB; private String text; }
I want to transfer <
Seems that you just need a cascaded groupingBy:
groupingBy
Map>> aMappedByKeyAAndKeyB = aList.stream() .collect(Collectors.groupingBy(A::getKeyA, Collectors.groupingBy(A::getKeyB)));