class CachedCollection implements ICachedCollection {

    @Override
    public List<IObject> getItems(final String key) throws GetCacheItemException {

        try {
            final List<IObject> items = map.getOrDefault(key, new ArrayList<>());
            if (items.isEmpty()) {
                try (IPoolGuard poolGuard = new PoolGuard(connectionPool)) {
                    IDatabaseTask getItemTask = IOC.resolve(
                            Keys.getOrAdd("db.cached_collection.get_item"),
                            poolGuard.getObject(),
                            collectionName,
                            keyName,
                            key,
                            (IAction<IObject[]>) foundDocs -> {
                                try {
                                    items.addAll(Arrays.asList(foundDocs));
                                } catch (Exception e) {
                                    throw new ActionExecuteException(e);
                                }
                            }
                    );

                    getItemTask.execute();
                    map.put(key, items);
                } catch (PoolGuardException e) {
                    throw new GetCacheItemException("Can't get connection from pool.", e);
                }
            }

            return items;
        } catch (TaskExecutionException e) {
            throw new GetCacheItemException("Error during execution read task.", e);
        } catch (ResolutionException e) {
            throw new GetCacheItemException("Can't resolve cached object.", e);
        }
    }

    public  CachedCollection(final IObject config);

}