refactor dao

This commit is contained in:
Loredana Crusoveanu 2018-09-23 17:54:41 +03:00
parent 1ee74058a2
commit 1a8eb6a0ef
1 changed files with 3 additions and 3 deletions

View File

@ -22,9 +22,9 @@ public class TodoDao implements Dao<Todo> {
@Override
public Collection<Todo> getAll() {
return Collections.unmodifiableCollection(todoList.stream()
return todoList.stream()
.filter(Objects::nonNull)
.collect(Collectors.toList()));
.collect(Collectors.collectingAndThen(Collectors.toList(), Collections::unmodifiableList));
}
@Override