Guest User

Untitled

a guest
Dec 14th, 2018
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.27 KB | None | 0 0
  1. List<Object> objects = ["A", ["B", "C"], "D", ["E"], [], null, "F"];
  2.  
  3. objects.stream().map(o -> {
  4. if (o instanceof List) {
  5. return ((List) o).stream();
  6. } else return objects.stream();
  7. }).filter(Objects::nonNull).collect(Collectors.toList()));
Add Comment
Please, Sign In to add comment