February 2018
Intermediate to advanced
356 pages
9h 10m
English
Also, we need to check if the news is fully revised by all mandatory reviewers. It is quite simple, we are using Java 8, and it provides the amazing Stream interface, which makes the collections interactions easier than before. Let's do this:
public Boolean revised() { return this.mandatoryReviewers.stream().allMatch(reviewer -> this.reviewers.stream() .anyMatch(review -> reviewer.id.equals(review.userId) && "approved".equals(review.status)));}
Thanks, Java 8, we appreciate it.