/**
 *    Copyright 2016-2018 the original author or authors.
 *
 *    Licensed under the Apache License, Version 2.0 (the "License");
 *    you may not use this file except in compliance with the License.
 *    You may obtain a copy of the License at
 *
 *       http://www.apache.org/licenses/LICENSE-2.0
 *
 *    Unless required by applicable law or agreed to in writing, software
 *    distributed under the License is distributed on an "AS IS" BASIS,
 *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *    See the License for the specific language governing permissions and
 *    limitations under the License.
 */
package org.mybatis.dynamic.sql.select.function;

import java.sql.JDBCType;
import java.util.List;
import java.util.Objects;
import java.util.Optional;

import org.mybatis.dynamic.sql.BindableColumn;
import org.mybatis.dynamic.sql.render.TableAliasCalculator;

public class Add<T extends Number> implements BindableColumn<T> {
    
    private String alias;
    private List<BindableColumn<T>> columns;
    
    private Add(List<BindableColumn<T>> columns) {
        this.columns = Objects.requireNonNull(columns);
    }

    @Override
    public Optional<String> alias() {
        return Optional.ofNullable(alias);
    }

    @Override
    public String renderWithTableAlias(TableAliasCalculator tableAliasCalculator) {
        StringBuilder builder = new StringBuilder();
        for (BindableColumn<T> column: columns) {
            if (builder.length() > 0) {
                builder.append(" + ");
            }
            builder.append(column.renderWithTableAlias(tableAliasCalculator));
        }
        return builder.toString();
    }

    @Override
    public BindableColumn<T> as(String alias) {
        Add<T> newColumn = new Add<>(columns);
        newColumn.alias = alias;
        return newColumn;
    }

    @Override
    public JDBCType jdbcType() {
        return columns.get(0).jdbcType();
    }

    @Override
    public Optional<String> typeHandler() {
        return columns.get(0).typeHandler();
    }

    public static <T extends Number> Add<T> of(List<BindableColumn<T>> columns) {
        return new Add<>(columns);
    }
}

@@ -794,16 +794,83 @@
 ptional;
+%0Aimport java.util.StringJoiner;%0Aimport java.util.stream.Collectors;
 %0A%0Aimport
@@ -1444,181 +1444,31 @@
     
-StringBuilder builder = new StringBuilder();%0A        for (BindableColumn%3CT%3E column: columns) %7B%0A            if (builder.length() %3E 0) %7B%0A                builder.append(%22 + %22);
+return columns.stream()
 %0A   
@@ -1468,34 +1468,32 @@
 m()%0A            
-%7D%0A
             buil
@@ -1490,25 +1490,23 @@
     
-  builder.append(
+.map(column -%3E 
 colu
@@ -1551,26 +1551,29 @@
 ulator))
-;
 %0A
+    
         
 %7D%0A      
@@ -1568,18 +1568,16 @@
     
-%7D%0A
         
 retu
@@ -1576,32 +1576,44 @@
     
-return builder.toString(
+  .collect(Collectors.joining(%22 + %22)
 );%0A 

Refactor for remove the loop and the StringBuilder