code: public void count(final SuccessCallback<Long> successCallback, final ErrorCallback errorCallback) {
          checkNotNull(successCallback);
          checkNotNull(errorCallback);
  
          final Callable<Long> call = new Callable<Long>() {
              @Override
              public Long call() throws Exception {
                  return SugarRecord.count(getSugarClass());
              }
          };
  
          final Future<Long> future = doInBackground(call);
          Long count;
  
          try {
              count = future.get();
  
              if (null == count) {
                  errorCallback.onError(new Exception("Error when trying to get count"));
              } else {
                  successCallback.onSuccess(count);
              }
  
          } catch (Exception e) {
              errorCallback.onError(e);
          }
      }
docs: Method that performs a count
  
  @param successCallback the callback that is executed if this is successful
  @param errorCallback the callback that is executed if there is an error