@Test
public void shouldPostFinalErrorWhenFromEmptyIntermediateResponseWhenFinalWasAlreadyDelivered() {

    VolleyError error = new VolleyError("Some error");
    when(mRequest.isFinished()).thenReturn(false);
    when(mRequest.isIntermediateResponseDelivered()).thenReturn(false);
    when(mRequest.isFinalResponseDelivered()).thenReturn(true);
    when(mRequest.getFinalResponseError()).thenReturn(error);
    mResponseDelivery.postEmptyIntermediateResponse(mRequest, BallResponse.ResponseSource.LOCAL);
    verify(mRequest).setIntermediateResponseDelivered(true);
    verify(mRequest).deliverError(error);
    verify(mRequest).finish(BallExecutorDelivery.MARKER_DONE_WITH_INTERMEDIATE_EMPTY_RESPONSE);
}