List<String> () { List<ClassInfo> allInfos = myClasses.values().stream().sorted(Comparator.comparing(info -> info.name)).toList(); List<String> lines = new ArrayList<>(); lines.add("Pre 1.6 classes:"); for (ClassInfo item : allInfos) { if (item.myTooOldClassVersion != null) { lines.add(" " + item.name + " has version " + item.myTooOldClassVersion); } } lines.add("Same classes from different JARs:"); Map<String, List<ClassInfo>> groupByName = allInfos.stream().collect(Collectors.groupingBy(info -> info.name, TreeMap::new, Collectors.toList())); for (Map.Entry<String, List<ClassInfo>> entry : groupByName.entrySet()) { if (entry.getValue().size() <= 1) continue; lines.add(" " + entry.getKey()); for (ClassInfo source : entry.getValue()) { lines.add(" " + source.source); } } lines.add("Transitively invalid classes:"); for (ClassInfo entry : allInfos) { if (entry.myIsNotValidReasons == null) continue; lines.add(" " + entry.name); for (String warning : entry.myIsNotValidReasons) { lines.add(" " + warning); } } return lines; }