package design.model.statistics; import java.util.Arrays; import design.model.Course; import design.model.Round; public class CourseStats extends StatisticsDecorator{ private Course course; public CourseStats(Statistics wrapped_statistics, Course course){ super(wrapped_statistics); this.course = course; } @Override public Round[] getRounds(){ return Arrays.stream(super.getRounds()) .filter(rounds -> (rounds.getCourse().getName().equals(course.getName()) && rounds.getCourse().getLocation().equals(course.getLocation()))) .toArray(Round[]::new); } }