class SpendProfileTableCalculator {

    public List<BigDecimal> calculateEligibleCostPerYear(ProjectResource project, List<BigDecimal> monthlyCost, List<LocalDateResource> months) {
        Integer startYear = new FinancialYearDate(DateUtil.asDate(project.getTargetStartDate())).getFiscalYear();
        Integer endYear = new FinancialYearDate(DateUtil.asDate(project.getTargetStartDate().plusMonths(project.getDurationInMonths()))).getFiscalYear();
        LinkedList<BigDecimal> eligibleCostPerYear = new LinkedList<>();
        IntStream.range(startYear, endYear + 1).
                mapToObj(
                        year -> {
                            BigDecimal totalForYear = BigDecimal.ZERO;

                            totalForYear = getEligibleCostMonthlyTotal(monthlyCost, months, year, totalForYear);
                            return eligibleCostPerYear.add(totalForYear);
                        }

                ).collect(toList());

        return eligibleCostPerYear;
    }

}