code: public static BaasResult<Long> countSync(String collection, BaasQuery.Criteria filter) {
          BaasBox box = BaasBox.getDefaultChecked();
          if (collection == null) throw new IllegalArgumentException("collection cannot be null");
          filter = filter==null?BaasQuery.builder().count(true).criteria()
                               :filter.buildUpon().count(true).criteria();
          Count request = new Count(box, collection, filter, RequestOptions.DEFAULT, null);
          return box.submitSync(request);
      }
docs: Synchronously retrieves the number of document readable to the user that match <code>filter</code>
  in <code>collection</code>
  
  @param collection the collection to doCount not <code>null</code>
  @param filter     a filter to apply to the request
  @return the result of the request