While working in a Java app, I recently needed to assemble a comma-delimited list of values to pass to another web service without knowing how many elements there would be i
Java 8 Native Type
List example; example.add(1); example.add(2); example.add(3); ... example.stream().collect(Collectors.joining(","));
Java 8 Custom Object:
List person; ... person.stream().map(Person::getAge).collect(Collectors.joining(","));