private static double calculateGain(List<Result> result) {
        double[] docScore = new double[result.size()];

        for (int i = 0; i < result.size(); i++) {
            Result rest = (Result) result.get(i);
            docScore[i] = rest.getResult();
        }
        return calculateGain(docScore.length, docScore);
    }