code: public static PrepareStatement prepare(String statement) {
          if (statement == null) {
              throw new NullPointerException("Statement to prepare cannot be null");
          }
          //this is a guard against "PREPARE SELECT", but not enough anymore as it could be "PREPARE name FROM SELECT"...
          if (statement.startsWith(PREPARE_PREFIX)) {
              statement = statement.replaceFirst(PREPARE_PREFIX, "");
          }
  
          //delegate to other factory method so that a name is generated
          return prepare(new N1qlQuery.RawStatement(statement));
      }
docs: Construct a {@link PrepareStatement} from a statement in {@link String} format.
  Statement shouldn't begin with "PREPARE", otherwise a syntax error may be returned by the server.
  
  @param statement the statement to prepare (not starting with "PREPARE").
  @return the prepared statement.
  @throws NullPointerException when statement is null.