你必须实现一个从列表中筛选绿苹果的功能 public static List<Apple> filterGreenApples(List<Apple> inventory) { List<Apple> result = new ArrayList<Apple>(); for(Apple apple: inventory){ if( "green".equals(apple.getColor() ) { result.add(apple); } } return result; }