class MessageProcessingSequenceRecoveryStrategy implements IResolveDependencyStrategy {

    @Override
    public <T> T resolve(final Object... args) throws ResolveDependencyStrategyException {
        try {
            IObject dump = (IObject) args[0];

            int maxDepth = ((Number) dump.getValue(maxDepthFieldName)).intValue();
            Iterator stepStack = ((Collection) dump.getValue(stepsStackFieldName)).iterator();
            Iterator chainsStack = ((Collection) dump.getValue(chainsStackFieldName)).iterator();
            IObject chainsDump = (IObject) dump.getValue(chainsDumpFieldName);

            IChainStorage storage = new ChainStorageDecorator(
                    IOC.resolve(Keys.getOrAdd(IChainStorage.class.getCanonicalName())),
                    chainsDump);

            Object mainChainId = IOC.resolve(Keys.getOrAdd("chain_id_from_map_name"), chainsStack.next());
            int mainChainPos = ((Number) stepStack.next()).intValue();

            IMessageProcessingSequence sequence = new MessageProcessingSequence(maxDepth, storage.resolve(mainChainId));
            sequence.goTo(0, mainChainPos + 1);

            int level = 1;

            while (stepStack.hasNext()) {
                Object chainId = IOC.resolve(Keys.getOrAdd("chain_id_from_map_name"), chainsStack.next());
                int pos = ((Number) stepStack.next()).intValue();

                sequence.callChain(storage.resolve(chainId));
                sequence.goTo(level++, pos + 1);
            }

            sequence.next();

            return (T) sequence;
        } catch (ResolutionException | ReadValueException | InvalidArgumentException | ClassCastException | ChainNotFoundException
                | NestedChainStackOverflowException e) {
            throw new ResolveDependencyStrategyException(e);
        }
    }

    public  MessageProcessingSequenceRecoveryStrategy();

}