import java.util.List; import java.util.ArrayList; import java.util.Collections; import java.util.Comparator; import java.util.stream.Collectors; class HighScores { private final List highScores; public HighScores(List highScores) { this.highScores = new ArrayList<>(highScores); } List scores() { return new ArrayList<>(highScores); } Integer latest() { return highScores.get(highScores.size() - 1); } Integer personalBest() { return Collections.max(highScores); } List personalTopThree() { return highScores.stream().sorted(Comparator.reverseOrder()).limit(3).collect(Collectors.toList()); } }