Primitives { public static void printTrackLengthStatistics(Album album) { IntSummaryStatistics trackLengthStats = album.getTracks() .mapToInt(track -> track.getLength()) .summaryStatistics(); System.out.printf("Max: %d, Min: %d, Ave: %f, Sum: %d", trackLengthStats.getMax(), trackLengthStats.getMin(), trackLengthStats.getAverage(), trackLengthStats.getSum()); }  static void printTrackLengthStatistics(Album album);  }
@Test public void albumStatistics() { Primitives.printTrackLengthStatistics(SampleData.aLoveSupreme); }