Why StringJoiner when we already have StringBuilder?
StringJoiner is very useful, when you need to join Strings in a Stream. As an example, if you have to following List of Strings: final List<String> strings = Arrays.asList(“Foo”, “Bar”, “Baz”); It is much more simpler to use final String collectJoin = strings.stream().collect(Collectors.joining(“, “)); as it would be with a StringBuilder: final String collectBuilder = … Read more