package uk.ac.ebi.quickgo.common.converter;

import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;
import java.util.stream.Stream;

/**
 * A useful class for converting stuff.
 *
 * @author Tony Wardell
 * Date: 28/07/2016
 * Time: 13:51
 * Created with IntelliJ IDEA.
 */
public class HelpfulConverter {

    /**
     * Turns "AAA", "BBB", "CCC" into "AAA,BBB,CCC".
     * @param values
     * @return
     */

    public static String toCSV(String... values) {
        return toCSV(Arrays.stream(values));
    }

    public static String toCSV(List<String> values) {
        return toCSV(values.stream());
    }

    public static String toCSV(Stream<String> stream){
        return stream.collect(Collectors.joining(","));
    }
}

@@ -754,11 +754,197 @@
 );%0A    %7D
+%0A%0A    public static String toCSV(Stream%3CString%3E stream, int quantityRequired)%7B%0A        return stream.limit(quantityRequired)%0A                     .collect(Collectors.joining(%22,%22));%0A    %7D
 %0A%7D%0A

Add another toCSV method.