How can I get this data structure using java 8 streams.
class A { B b; public A(B b) { this.b = b; } } class B { List<A> as; private int i; public B(int i) { this.i = i; } }
This is my object structure. Im trying to combine it,
Map<A, List<B>> bs
from,
List<A> as = new ArrayList<>(); as.add(a1); as.add(a2); as.add(a3);
source share