Requirement:
Please consider a function which generates List<List<String>>
and return the same.
So in Java 1.7, this can be considered as:
public List<List<String> function(){
List<List<String>> outList = new ArrayList<>();
List<String> inList = new ArrayList<>();
inList.add("ABC");
inList.add("DEF");
outList.add(inList);
outList.add(inList);
return outList;
}
Now in Java 8, the signature of the function provided to me is:
public Stream<Stream<String>> function() {
List<List<String>> outList = new ArrayList<>();
List<String> inList = new ArrayList<>();
inList.add("ABC");
inList.add("DEF");
outList.add(inList);
outList.add(inList);
//How to convert the outList into Stream<Stream<String>> and return.
}
How to convert List<List<String>>
into Stream<Stream<String>>
.
> and return the same.* ?
>