@Override
    public <T extends PersistentObject> T create(T entity) {
        if (entity.getId() == null) {
            long id = idGenerator.incrementAndGet();
            entity.setId(id);
        }
        dataStore.putIfAbsent(entity.getId(), entity);
        return entity;
    }