I\'m trying to refactor the following code to lambda expressions with `stream, especially the nested foreach loops:
public static Result match (Response rsp) {
You can iterate nested loops like below
allAssessmentsForJob.getBody().stream().forEach(assessment -> { jobAssessments.stream().forEach(jobAssessment -> { if (assessment.getId() == jobAssessment.getAssessmentId()) { jobAssessment.setAssessment(assessment); } }); });