String (@NotNull PsiJavaFile file, @NotNull String fullyQualifiedName) { for (PsiClass aClass : file.getClasses()) { String outerClassName = aClass.getQualifiedName(); if (outerClassName != null && fullyQualifiedName.startsWith(outerClassName)) { return fullyQualifiedName.substring(outerClassName.lastIndexOf('.') + 1); } } return ClassUtil.extractClassName(fullyQualifiedName); }