I’m a Java developer , and I recently got a code review comment that I should use Java Streams API to write a piece of code that took me 10 lines to…