How is \Magento\Checkout\Model\Session::replaceQuote() implemented and used?

Implementation

Usages

1. Magento/Authorizenet/Controller/Directpost/Payment::_returnCustomerQuote()

Details: How does the Authorize.Net module restore a quote from an order in the case of a payment failure?

2. \Magento\Checkout\Model\Session::restoreQuote()

Details: How is \Magento\Checkout\Model\Session::restoreQuote() implemented and used?