public static int getTrailingWhitespace(String line) {
    return line.length() - line.trim().length() - getIndent(line);
  }
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