public static List<Apple> filterApples(List<Apple> inventory, Predicate<Apple> predicate){
        List<Apple> filteredApples = new ArrayList<>();
        for (Apple apple : inventory) {
            if(predicate.test(apple)) {
                filteredApples.add(apple); //Added only if the passed predicate matches the condition
            }
        }
        return filteredApples;
    }