@Test
public void shouldDeliverFinalErrorResponseWhenIntermediateIsDelivered() {

    VolleyError error = new VolleyError("Some error");
    when(mRequest.isIntermediateResponseDelivered()).thenReturn(true);
    when(mResponse.isIntermediate()).thenReturn(false);
    when(mResponse.isSuccess()).thenReturn(false);
    when(mResponse.getError()).thenReturn(error);
    when(mResponse.getResponseSource()).thenReturn(BallResponse.ResponseSource.NETWORK); // or cache, whatever
    mResponseDelivery.postResponse(mRequest, mResponse);
    verify(mRequest).deliverError(error);
    verify(mRequest, new LastInteraction()).finish(String.format(BallExecutorDelivery.MARKER_DONE_WITH_RESPONSE_FROM, mResponse.getResponseSource().toString().toLowerCase()));
}