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

      final Map<Object, Object> toInsert = op.values().stream().collect(Collectors.toMap(keyExtractor::extract, x -> x));
      toInsert.forEach((k, v) -> {
        Object result = store.putIfAbsent(k, v);
        if (result != null) {
          throw new BackendException(String.format("Duplicate key %s for %s", k, entityType()));
        }
      });

      return Flowable.just(WriteResult.unknown());
    }
mapping between class and its store
criteria/inmemory/src/org/immutables/criteria/inmemory/InMemoryBackend.java