private static @Nullable String getFqn(@Nullable PsiJavaCodeReferenceElement ref) {
    if (ref != null) {
      final PsiReference reference = ref.getReference();
      if (reference != null && reference.resolve() instanceof PsiClass cls) {
        return cls.getQualifiedName();
      }
    }
    return null;
  }
private static @Nullable String getFqn(@Nullable PsiJavaCodeReferenceElement ref)