Replaced deprecated hasItem method with the proposed alternative.
Added examples for Java 8 IntSummaryStatistics.