IntSummaryStatistics (List<List<List<String>>> list) { IntSummaryStatistics stat = new IntSummaryStatistics(); for (List<List<String>> l : list) { if (l != null) { for (List<String> lst : l) { if (lst != null) { for (String str : lst) { int length = str.length(); stat.accept(length); } } } } } return stat; }