String renderBuildCode(@NotNull PsiVariable psiVariable, @NotNull String fieldName, @NotNull String builderVariable) {
    final PsiManager psiManager = psiVariable.getManager();
    final PsiType elementType = getOneElementType(psiVariable.getType(), psiManager);
    String result;
    if (SingularCollectionClassNames.JAVA_UTIL_NAVIGABLE_SET.equals(collectionQualifiedName)) {
      result = """
        {2}<{1}> {0} = new java.util.TreeSet<{1}>();
        if ({3}.{0} != null) {0}.addAll({3}.{0});
        {0} = java.util.Collections.unmodifiableNavigableSet({0});
        """;
    }
    else if (SingularCollectionClassNames.JAVA_UTIL_SORTED_SET.equals(collectionQualifiedName)) {
      result = """
        {2}<{1}> {0} = new java.util.TreeSet<{1}>();
        if ({3}.{0} != null) {0}.addAll({3}.{0});
        {0} = java.util.Collections.unmodifiableSortedSet({0});
        """;
    }
    else if (SingularCollectionClassNames.JAVA_UTIL_SET.equals(collectionQualifiedName)) {
      result = """
        {2}<{1}> {0};
        switch ({3}.{0} == null ? 0 : {3}.{0}.size()) '{'
         case 0:\s
           {0} = java.util.Collections.emptySet();
           break;
         case 1:\s
           {0} = java.util.Collections.singleton({3}.{0}.get(0));
           break;
         default:\s
           {0} = new java.util.LinkedHashSet<{1}>({3}.{0}.size() < 1073741824 ? 1 + {3}.{0}.size() + ({3}.{0}.size() - 3) / 3 : java.lang.Integer.MAX_VALUE);
           {0}.addAll({3}.{0});
           {0} = java.util.Collections.unmodifiableSet({0});
        '}'
        """;
    }
    else {
      result = """
        {2}<{1}> {0};
        switch ({3}.{0} == null ? 0 : {3}.{0}.size()) '{'
        case 0:\s
         {0} = java.util.Collections.emptyList();
         break;
        case 1:\s
         {0} = java.util.Collections.singletonList({3}.{0}.get(0));
         break;
        default:\s
         {0} = java.util.Collections.unmodifiableList(new java.util.ArrayList<{1}>({3}.{0}));
        '}'
        """;
    }
    return MessageFormat.format(result, fieldName, elementType.getCanonicalText(false), collectionQualifiedName, builderVariable);
  }
String renderBuildCode(@NotNull PsiVariable psiVariable, @NotNull String fieldName, @NotNull String builderVariable)