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

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

/**
 * 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 Arrays.stream(values).collect(Collectors.joining(","));
    }
}

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(","));
    }
}

Create and refactor over-loaded versions of to CSV
Create and refactor over-loaded versions of to CSV
