I recently discovered Java streams. Love it and couldn't notice that example readme could be easily written with streams :
List<ProductDisplayInfo> list = Arrays
.asList(products)
.stream()
.filter(p -> p.getCategory() == 2 || p.getCategory() == 5 && isProductUnderDiscount(p))
.map(p -> new ProductDisplayInfo(p))
.collect(Collectors.toList());
https://docs.oracle.com/javase/8/docs/api/java/util/stream/p...