String (@NotNull PsiVariable psiVariable, @NotNull String fieldName, @NotNull String builderVariable) { final PsiManager psiManager = psiVariable.getManager(); final PsiType psiFieldType = psiVariable.getType(); final PsiType elementType = PsiTypeUtil.extractOneElementType(psiFieldType, psiManager); return MessageFormat.format( "{2}<{1}> {0} = " + "{4}.{0} == null ? " + "{3}.<{1}>of() : " + "{4}.{0}.build();\n", fieldName, elementType.getCanonicalText(false), collectionQualifiedName, typeCollectionQualifiedName, builderVariable); }