public static String join(String separator, List<?> objects) {
    StringBuilder builder = new StringBuilder();
    int size = objects.size();
    for (int i = 0; i < size; i++) {
      builder.append(objects.get(i));
      if (i != size - 1)
        builder.append(separator);
    }
    return builder.toString();
  }
Returns the number of whitespace characters at the end of the given line.

@param line
@return
spock-core/src/main/java/org/spockframework/util/TextUtil.java