String (@NotNull String singularName, @NotNull BuilderInfo info) { final String codeBlockTemplate = """ if({0}==null)'{'throw new NullPointerException("{0} cannot be null");'}' if (this.{0} == null) this.{0} = new java.util.ArrayList<{2}>();\s this.{0}.addAll({0}); return {1};"""; final PsiType oneElementType = PsiTypeUtil.extractOneElementType(info.getFieldType(), info.getManager()); return MessageFormat.format(codeBlockTemplate, singularName, info.getBuilderChainResult(), oneElementType.getCanonicalText(false)); }