@Test(expected = CRestException.class)
public void shouldShouleThrowLastExceptionWhenAllDeserializerHaveFailed() throws Exception {

    Exception e1 = new Exception();
    Exception e2 = new Exception();
    Deserializer mockDeserializer1 = mock(Deserializer.class);
    Deserializer mockDeserializer2 = mock(Deserializer.class);
    when(mockMethodConfig.getDeserializers()).thenReturn(new Deserializer[]{mockDeserializer1, mockDeserializer2});
    when(mockDeserializer1.deserialize(String.class, String.class, mockDumpStream, UTF8)).thenThrow(e1);
    when(mockDeserializer2.deserialize(String.class, String.class, mockDumpStream, UTF8)).thenThrow(e2);
    mockStatic(IOs.class);
    when(IOs.toByteArray(mockStream, true)).thenReturn(SOME_STRING_UTF8_BYTES);
    try {
        toTest.deserialize(mockResponse);
        fail();
    } catch (Exception e) {
        verify(mockDumpStream, times(2)).mark(0);
        verify(mockDumpStream, times(2)).reset();
        assertSame(e2, e.getCause());
        throw e;
    }
}