class SpendProfileTableCalculator {

    public List<BigDecimal> calculateMonthlyTotals(Map<Long, List<BigDecimal>> tableData, int numberOfMonths) {
        return IntStream.range(0, numberOfMonths).mapToObj(index ->
            tableData.values()
                    .stream()
                    .map(list -> list.get(index))
                    .reduce(BigDecimal.ZERO, BigDecimal::add)
        ).collect(Collectors.toList());
    }

}