3 ms·
You forgot the map operation (and I would also filter out nulls): (just to be pedantic) foo.stream() .filter(s -> s != null) .map(s -> s.descriptio
by teh64 11y ago
You forgot the map operation (and I would also filter out nulls): (just to be pedantic)
foo.stream()
.filter(s -> s != null)
.map(s -> s.description())
.filter(s -> !s.isEmpty())
.collect(Collectors.joining("\n"));