I am trying to achieve the following by converting two for loops using Java Streams.
Set<Type2> set = new HashSet<>();
for (Test1 test1 : testlist1) { // testlist1 is a list
for (Test2 test2 : test1.getList()) { // test1.getList() returns a list
set.add(test2);
}
}
New to Java streams and trying to convert it.