public static String join(Collection<String> list, String separator) {
    Iterator<String> iterator = list.iterator();
    StringBuilder out = new StringBuilder();
    if (iterator.hasNext()) {
      out.append(iterator.next());
    }
    while (iterator.hasNext()) {
      out.append(separator).append(iterator.next());
    }
    return out.toString();
  }
Join a list of strings with the given separator.

@param list      The list of strings
@param separator The separator
@return the resulting string
plc4j/drivers/ctrlx/src/main/java/org/apache/plc4x/java/ctrlx/readwrite/rest/datalayer/StringUtil.java