class OfflineObjectStore implements ParseObjectStore<T> {

  @Override
  public Task<Boolean> existsAsync() {
    // We need to set `ignoreACLs` since we can't use ACLs without the current user.
    ParseQuery<T> query = ParseQuery.<T>getQuery(className)
        .fromPin(pinName)
        .ignoreACLs();
    return query.countInBackground().onSuccessTask(new Continuation<Integer, Task<Boolean>>() {
      @Override
      public Task<Boolean> then(Task<Integer> task) throws Exception {
        boolean exists = task.getResult() == 1;
        if (exists) {
          return Task.forResult(true);
        }
        return legacy.existsAsync();
      }
    });
  }

  public  OfflineObjectStore(Class<T> clazz, String pinName, ParseObjectStore<T> legacy);
  public  OfflineObjectStore(String className, String pinName, ParseObjectStore<T> legacy);

}