docs: public static String qualifyType(VisitorState state, SuggestedFix.Builder fix, Symbol sym) {
      if (sym.getKind() == ElementKind.TYPE_PARAMETER) {
        return sym.getSimpleName().toString();
      }
      Deque<String> names = new ArrayDeque<>();
      for (Symbol curr = sym; curr != null; curr = curr.owner) {
        names.addFirst(curr.getSimpleName().toString());
        Symbol found =
            FindIdentifiers.findIdent(curr.getSimpleName().toString(), state, KindSelector.VAL_TYP);
        if (found == curr) {
          break;
        }
        if (curr.owner != null && curr.owner.getKind() == ElementKind.PACKAGE) {
          // If the owner of curr is a package, we can't do anything except import or fully-qualify
          // the type name.
          if (found != null) {
            names.addFirst(curr.owner.getQualifiedName().toString());
          } else {
            fix.addImport(curr.getQualifiedName().toString());
          }
          break;
        }
      }
      return Joiner.on('.').join(names);
    }