import java.util.*;
import java.util.stream.Collectors;
class Student {
private String name;
private int age;
private Map<String, Integer> scores;
public Student(String name, int age, Map<String, Integer> scores) {
this.name = name;
this.age = age;
this.scores = scores;
}
public String getName() {
return name;
}
public int getAge() {
return age;
}
public Map<String, Integer> getScores() {
return scores;
}
}
public class Main {
public static void main(String[] args) {
List<Student> studentList = new ArrayList<>();
Map<String, Integer> scores1 = new HashMap<>();
scores1.put("Math", 85);
scores1.put("English", 92);
studentList.add(new Student("Alice", 20, scores1));
Map<String, Integer> scores2 = new HashMap<>();
scores2.put("Math", 88);
scores2.put("English", 89);
studentList.add(new Student("Bob", 17, scores2));
List<String> resultList = studentList.stream()
.filter(student -> student.getAge() > 18)
.filter(student -> student.getScores().values().stream().anyMatch(score -> score > 90))
.map(Student::getName)
.collect(Collectors.toList());
System.out.println(resultList);
}
}