import java.util.ArrayList; import java.util.List; import org.eclipse.epsilon.common.util.CollectionUtil; public class EpsilonJARExample { public static void main(String[] args) { List<StudentScore> scores = new ArrayList<>(); List<StudentScore> filteredScores = CollectionUtil.filter(scores, score -> score.getScore() > 90); for (StudentScore score : filteredScores) { System.out.println(score.getName() + ": " + score.getScore()); } } static class StudentScore { private String name; private int score; public StudentScore(String name, int score) { this.name = name; this.score = score; } public String getName() { return name; } public int getScore() { return score; } } }


上一篇:
下一篇:
切换中文