private Publisher<WriteResult> update(StandardOperations.Update op) {
      if (op.values().isEmpty()) {
        return Flowable.just(WriteResult.empty());
      }

      Map<Object, Object> toUpdate = op.values().stream().collect(Collectors.toMap(keyExtractor::extract, v -> v));

      if (op.upsert()) {
        return Flowable.fromCallable(() -> {
          store.putAll(toUpdate);
          return WriteResult.unknown();
        });
      }

      return Flowable.fromCallable(() -> {
        toUpdate.forEach(store::replace);
        return WriteResult.unknown();
      });
    }
mapping between class and its store
criteria/inmemory/src/org/immutables/criteria/inmemory/InMemoryBackend.java