@Override
  public void handleRestRequest(RestRequest req, Map<String, String> wireAttrs, RequestContext requestContext,
      TransportCallback<RestResponse> callback)
  {
    _transportDispatcher.handleRestRequest(req, wireAttrs, requestContext,
        new RequestFinalizerTransportCallback<>(callback, requestContext, req));
  }
@Test(dataProvider = "throwTransportCallbackException")
  public void testHandleRestRequestOrdering(boolean throwTransportCallbackException)
  {
    when(_restTransportResponse.getResponse())
        .thenReturn(_restResponse);

    final TestTransportCallback<RestResponse> transportCallback = new TestTransportCallback<>(throwTransportCallbackException);
    _outerDispatcher.handleRestRequest(null, null, new RequestContext(), transportCallback);

    Assert.assertEquals(_outerDispatcher._executionOrder, 1);
    Assert.assertEquals(_innerDispatcher._executionOrder, 2);
    Assert.assertEquals(_innerDispatcher._transportCallback._executionOrder, 3);
    Assert.assertEquals(_outerDispatcher._transportCallback._executionOrder, 4);
    Assert.assertEquals(transportCallback._executionOrder, 5);
    Assert.assertEquals(_requestFinalizer._executionOrder, 6, "Expected request to be finalized after the callback.");
  }