/*
 * Copyright (c) 2015-2018 Dzikoysk
 *
 * 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.panda_lang.panda.utilities.commons.redact;

import java.util.Collection;
import java.util.function.Function;

public class ContentJoiner {

    private final String separator;
    private final StringBuilder builder;

    private ContentJoiner(String separator) {
        this.separator = separator;
        this.builder = new StringBuilder();
    }

    public <T> ContentJoiner join(Collection<T> elements, Function<T, ?> mapper) {
        for (T element : elements) {
            append(mapper.apply(element));
        }

        return this;
    }

    public ContentJoiner join(Collection<?> elements) {
        for (Object element : elements) {
            append(element);
        }

        return this;
    }

    public ContentJoiner append(Object element) {
        builder.append(element).append(separator);
        return this;
    }

    @Override
    public String toString() {
        return builder.substring(0, builder.length() - separator.length());
    }

    public static ContentJoiner on(String separator) {
        return new ContentJoiner(separator);
    }

}

@@ -651,16 +651,41 @@
 edact;%0A%0A
+import java.util.Arrays;%0A
 import j
@@ -705,16 +705,16 @@
 ection;%0A
-
 import j
@@ -975,32 +975,166 @@
 ilder();%0A    %7D%0A%0A
+    public %3CT%3E ContentJoiner join(T%5B%5D elements, Function%3CT, ?%3E mapper) %7B%0A        return join(Arrays.asList(elements), mapper);%0A    %7D%0A%0A
     public %3CT%3E C
@@ -1283,32 +1283,32 @@
 t));%0A        %7D%0A%0A
-
         return t
@@ -1311,32 +1311,137 @@
 rn this;%0A    %7D%0A%0A
+    public ContentJoiner join(Object... elements) %7B%0A        return join(Arrays.asList(elements));%0A    %7D%0A%0A
     public Conte

Fix ContentJoiner