public static boolean isJavaIdentifier(String id) {
    if (id == null || id.length() == 0
        || !Character.isJavaIdentifierStart(id.charAt(0)))
      return false;

    for (int i = 1; i < id.length(); i++)
      if (!Character.isJavaIdentifierPart(id.charAt(i)))
        return false;

    return true;
  }
Checks whether the given statement represents a data table separator.
A data table separator is an expression statement consisting of a
variable expression whose name is two or more underscores and
that does not reference any existing variable, parameter or field.

@param stat the statement to check for being a data table separator
@return whether the given statement is a data table separator
spock-core/src/main/java/org/spockframework/compiler/AstUtil.java