Here you can find the source of commaSeparated(Stream
public static String commaSeparated(Stream<String> stream)
//package com.java2s; //License from project: Apache License import java.util.Arrays; import java.util.stream.Collectors; import java.util.stream.Stream; public class Main { public static final String LIST_SEPARATOR = ", "; public static String commaSeparated(Stream<String> stream) { return stream.collect(Collectors.joining(LIST_SEPARATOR)); }//from ww w .j a v a 2 s.co m public static String commaSeparated(String[] strings) { return commaSeparated(Arrays.stream(strings)); } }