I have the following snippet and I wonder if and how it is possible to replace it with Java-streams/Java 8 API
List<Borrower> borrowers = creditcomplex.getBorrowers();
for (Borrower borrower : borrowers) {
List<Facility> facilities = borrower.getFaciliies();
for (Facility facility : facilities) {
List<RepaymentSchedule> repaymentScheduleList = facility.getrepaymentSchedule();
if (repaymentScheduleList != null) {
for (RepaymentSchedule repaymentschedule : repaymentScheduleList) {
double[] repayment =
amortizationService.calculateAmortizationSchedule(repaymentschedule);
double[] drawdown =
amortizationService.calculateRepaymentSchedule(repaymentschedule);
double[] outstandingProfie = amortizationService
.calculateOutstandingSchedule(repaymentschedule);
}
}
}
}