public static <T> List<T> filter(List<T> inventory, Predicate predicate) {
        List<T> result = new ArrayList(); // No diamond JAVA 8 Feature required on right side
        for(T e:inventory) {
            if(predicate.test(e)){
                result.add(e);
            }
        }
        return result;
    }