String (@NotNull PsiClass cls) { StringBuilder result = new StringBuilder(); for (; cls != null; cls = cls.getContainingClass()) { String name = cls.getName(); if (name == null) break; if (!result.isEmpty()) result.insert(0, '.'); result.insert(0, name); } return result.toString(); }