Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- List<Object> objects = ["A", ["B", "C"], "D", ["E"], [], null, "F"];
- objects.stream().map(o -> {
- if (o instanceof List) {
- return ((List) o).stream();
- } else return objects.stream();
- }).filter(Objects::nonNull).collect(Collectors.toList()));
Add Comment
Please, Sign In to add comment