import java.util.List;
import java.util.stream.Collectors;

class Ideone {
	public static void main (String[] args) {
		List<Student> students = List.of(1.0, 2.0, 3.0, 4.0).stream()
				.map(Student::of)
				.collect(Collectors.toList());
		
		System.out.println(sumScore(students));
	}
	
	public static double sumScore(List<? extends Student> students) {
		return students.stream()
			.mapToDouble(Student::getScore)
			.sum();
	}
}

class Student {
	final double score;
	
	private Student(double score) {
		this.score = score;
	}
	
	public static Student of(double score) {
		return new Student(score);
	}
	
	public double getScore() {
		return score;
	}
}