convert Collection into string as comma seperated in Java 8
listOfString object contains ["A","B","C" ,"D"] elements-
listOfString.stream().map(ele->"'"+ele+"'").collect(Collectors.joining(","))
Output is :- 'A','B','C','D'
And Convert Strings Array to List in Java 8
String string[] ={"A","B","C","D"};
List<String> listOfString = Stream.of(string).collect(Collectors.toList());