using collectingAndThen
This commit is contained in:
parent
31a8f2a4ec
commit
f599419181
|
@ -22,9 +22,9 @@ public class TodoDao implements Dao<Todo> {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Collection<Todo> getAll() {
|
public Collection<Todo> getAll() {
|
||||||
return Collections.unmodifiableCollection(todoList.stream()
|
return todoList.stream()
|
||||||
.filter(Objects::nonNull)
|
.filter(Objects::nonNull)
|
||||||
.collect(Collectors.toList()));
|
.collect(Collectors.collectingAndThen(Collectors.toList(), Collections::unmodifiableList));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
Loading…
Reference in New Issue