public void applyAllRecoveredTransactions(final TransactionPlayerListener commitListener,
            final TransactionPlayerListener rollbackListener) throws TestException {

        if (_recoveryDisabledForTestMode) {
            return;
        }
        boolean started = false;
        /*
         * If there is a checkpoint Transaction record, reset its commit
         * timestamp to the checkpoint timestamp to ensure it gets applied
         * first. This is required to ensure all Accumulator values are
         * initialized correctly to their checkpoint snapshot values before any
         * deltas are applied.
         */
        TransactionMapItem checkpointTransactionItem = _recoveredTransactionMap
                .get(_lastValidCheckpoint.getTimestamp());
        if (checkpointTransactionItem != null) {
            checkpointTransactionItem.setCommitTimestamp(_lastValidCheckpoint.getTimestamp());
        }

        final SortedSet<TransactionMapItem> sorted = new TreeSet<TransactionMapItem>(_recoveredTransactionMap.values());

        if (!sorted.isEmpty()) {
            TransactionMapItem last = sorted.last();
            assert last.getCommitTimestamp() <= _persistit.getTimestampAllocator().getCurrentTimestamp();
        }

        for (final TransactionMapItem item : sorted) {
            TransactionPlayerListener listener = item.isCommitted() ? commitListener : rollbackListener;
            try {
                if (!started) {
                    commitListener.startRecovery(item.getStartAddress(), item.getCommitTimestamp());
                    started = true;
                }

                _player.applyTransaction(item, listener);
                if (item.isCommitted()) {
                    _appliedTransactionCount++;
                } else {
                    _abortedTransactionCount++;
                }

                if ((_appliedTransactionCount + _abortedTransactionCount) % APPLY_TRANSACTION_LOG_COUNT == 0) {
                    _persistit.getLogBase().recoveryProgress.log(_appliedTransactionCount, _abortedTransactionCount,
                            _recoveredTransactionMap.size() - _appliedTransactionCount - _abortedTransactionCount);
                }
            } catch (TestException te) {
                // Exception thrown by a unit test to interrupt recovery
                _persistit.getLogBase().recoveryException.log(te, item);
                throw te;
            } catch (Exception pe) {
                _persistit.getLogBase().recoveryException.log(pe, item);
                _errorCount++;
            }
        }
        _branchMap.clear();
    }