class CachedCollection implements ICachedCollection {

    @Override
    public void delete(final IObject message) throws DeleteCacheItemException {
        try {
            try (IPoolGuard poolGuard = new PoolGuard(connectionPool)) {
                IDatabaseTask deleteTask = IOC.resolve(
                    Keys.getOrAdd("db.cached_collection.delete"),
                    poolGuard.getObject(),
                    collectionName,
                    message
                );
                deleteTask.execute();
            } catch (PoolGuardException e) {
                throw new DeleteCacheItemException("Can't get connection from pool.", e);
            } catch (TaskExecutionException e) {
                throw new DeleteCacheItemException("Error during execution delete task.", e);
            }

            String key = specificKeyNameField.in(message);
            List<IObject> items = map.get(key);
            if (items != null) {
                for (IObject obj : items) {
                    if (idField.in(obj).equals(idField.in(message))) {
                        items.remove(obj);
                        break;
                    }
                }
            }
        }  catch (ResolutionException e) {
            throw new DeleteCacheItemException("Can't resolve cached object.", e);
        } catch (InvalidArgumentException | ReadValueException e) {
            throw new DeleteCacheItemException("Can't delete cached object.", e);
        }
    }

    public  CachedCollection(final IObject config);

}