public sealed interface Shape permits Circle, Rectangle, Square {}

// List – streams + collectors public List<Todo> list(boolean onlyCompleted) return store.values().stream() .filter(t -> onlyCompleted == t.completed()) .collect(Collectors.toUnmodifiableList());