#vulnerable code 
                                public static <E, F extends  Number> Double average(final Iterable<E> iterable, final Function<E, F> func) {
        F sum = sum(iterable, func);
        return sum.doubleValue() / size(iterable);
    } 
                            #location 3 
                            #vulnerability type NULL_DEREFERENCE
#fixed code
                                public static <E, F extends  Number> Double average(final Iterable<E> iterable, final Function<E, F> func) {
        F sum = sum(iterable, func);
        if (sum == null) {
            return null;
        }
        return sum.doubleValue() / size(iterable);
    }