public static <T> Statistic from(List<T> afterValueItems, List<T> beforeValueItems, ValueExtractor<T> valueExtractor) {
        long max = 0, min = 0;
        double sum = 0;

        for (int i = 0; i < afterValueItems.size(); i++) {
            long beforeValue = valueExtractor.getValue(beforeValueItems.get(i));
            long afterValue = valueExtractor.getValue(afterValueItems.get(i));
            long value = afterValue - beforeValue;

            if (i > 0) {
                if (value < min) {
                    min = value;
                }

                if (value > max) {
                    min = value;
                }
            } else {

                max = value;
                min = value;
            }

            sum += value;
        }
        return new Statistic(max, min, Math.round(sum / afterValueItems.size()));
    }