Deloitte interview question

Asked on java streams which was tough one