code: private static String quoteSort(Sort[] sort) {
          LinkedList<String> sorts = new LinkedList<String>();
          for (Sort pair : sort) {
              sorts.add(String.format("{%s: %s}", Helpers.quote(pair.getName()), Helpers.quote(pair.getOrder().toString())));
          }
          return sorts.toString();
      }
docs: sorts are a bit more awkward and need a helper...