@Override
    public Result execute(Operation operation) {
      if (operation instanceof StandardOperations.Select) {
        Query query = ((StandardOperations.Select) operation).query();
        if (query.count()) {
          // just count number of elements
          return DefaultResult.of(Flowable.fromPublisher(existing).count().toFlowable());
        }
      }

      return DefaultResult.of(existing);
    }
Backend which returns same result for any operation. It can also perform basic count.
Intended for simple tests.
criteria/common/test/org/immutables/criteria/repository/FakeBackend.java