code: @SuppressWarnings("unchecked")
    public Query orderBy(String... keys) {
      checkNotNull(keys, "Keys should not be null.");
      if (keys.length == 0) {
        throw new IllegalArgumentException("Cannot have an empty keys array.");
      }
  
      for (int i = 0; i < keys.length; ++i) {
        final String key = keys[i];
        checkNotEmpty(key, "Key at %d to order by must not be empty.", i);
  
        if (key.startsWith("fields.") && !hasContentTypeSet()) {
          throw new IllegalStateException(format("Key at %d uses \"fields.\" but cannot be "
              + "used without setting a content type first.", i));
        }
      }
  
      this.params.put(PARAMETER_ORDER, join(keys));
      return (Query) this;
    }
docs: Order result by the multiple keys.
  <p>
  Please do not forget to include the content type if you are requesting to order
  by a field.
  
  @param keys the keys to be ordered by.
  @return the calling query for chaining.
  @throws IllegalArgumentException if keys is null.
  @throws IllegalArgumentException if keys is empty.
  @throws IllegalArgumentException if one key is null.
  @throws IllegalArgumentException if one key is empty.
  @throws IllegalStateException    if one key requests a field, but no content type is requested.
  @see #withContentType(String)
  @see #orderBy(String)