My goal is to unwrap a list of singles of list of ints, and get all it's elements, in order to put it on a list.
List<Single<List<Int>>> listOfSinglesOfListofInts = getListSingleListType(); // random method that gives us that.
List<Int> intList = new ArrayList<>();
My goal is to move move all Int contents from listOfSinglesOfListOfInts to listInt. Here is what I tried:
ListOfSinglesOfListOfInt.stream().map(
singleListOfInts -> singleListOfInts.map(
listOfInts -> intList.addAll(listOfInts)
)
);
return listInt;
The size of listInt is always 0.
What would be the correct way of accomplishing this?