DoubleSummaryStatistics (List<String> strings) { DoubleSummaryStatistics stat = new DoubleSummaryStatistics(); for (String str : strings) { if (str != null) { stat.accept(str.length() / 2.0); } } return stat; }