Merge dependencies of element with further dependencies. First parent dependencies are checked, and then
        immediate dependencies of the current element should be added to the list, but without duplicating any entries.

        :param item: Item.
        :param resolve_parent: Function to resolve parent dependencies.
        :type resolve_parent: function
        :type parents: collections.Iterable
        :return: List of recursively resolved dependencies of this container.
        :rtype: list
        :raise CircularDependency: If the current element depends on one found deeper in the hierarchy.

def merge_dependency(self, item, resolve_parent, parents):
        """
        Merge dependencies of element with further dependencies. First parent dependencies are checked, and then
        immediate dependencies of the current element should be added to the list, but without duplicating any entries.

        :param item: Item.
        :param resolve_parent: Function to resolve parent dependencies.
        :type resolve_parent: function
        :type parents: collections.Iterable
        :return: List of recursively resolved dependencies of this container.
        :rtype: list
        :raise CircularDependency: If the current element depends on one found deeper in the hierarchy.
        """
        dep = []
        for parent_key in parents:
            if item == parent_key:
                raise CircularDependency(item, True)
            parent_dep = resolve_parent(parent_key)
            if item in parent_dep:
                raise CircularDependency(item)
            merge_list(dep, parent_dep)
        merge_list(dep, parents)
        return dep