void (DependencyContext context, PrintStream stream) { final StringBuilder sb = new StringBuilder(); sb.append("Module package: ").append(context.getValue(name)); final Set<Integer> moduleNames = myModuleNames; if (!moduleNames.isEmpty()) { final List<String> names = new ArrayList<>(); for (Integer moduleName : moduleNames) { names.add(context.getValue(moduleName)); } names.sort(String::compareToIgnoreCase); sb.append(" to"); for (String s : names) { sb.append(" ").append(s); } } stream.println(sb); }