@Test
public void writeDoesNotRethrow() {

    // given
    FailedItemMarshaller failedItemMarshaller = new FailedItemMarshaller();
    Bytes bytes = mock(Bytes.class);
    RuntimeException expectedException = spy(new RuntimeException("test exception"));
    when(bytes.outputStream()).thenThrow(expectedException);
    // when
    failedItemMarshaller.write(bytes, mock(ItemSource.class));
    // then
    verify(expectedException, times(1)).getMessage();
}