String () { final String[] t = new String[myTypeMap.size()]; int k = 0; for (final TypeMigrationUsageInfo info : myTypeMap.keySet()) { final LinkedList<PsiType> types = myTypeMap.get(info); final StringBuilder b = new StringBuilder(); if (types != null) { b.append(info.getElement()).append(" : "); b.append(StringUtil.join(types, psiType -> psiType.getCanonicalText(), " ")); b.append("\n"); } t[k++] = b.toString(); } Arrays.sort(t); final StringBuilder buffer = new StringBuilder(); for (String aT : t) { buffer.append(aT); } return buffer.toString(); }