@Test
public void errorIsReThrownAndLoggedAppropriately() {

    final String exceptionMessage = "Lorem ipsum dolor sit amet, consectetur adipiscing elit.";
    final Error error = new OutOfMemoryError(exceptionMessage);
    final String expectedLogMessage = MessageFormat.format(LOG_MESSAGE_PATTERN, CLASS_NAME);
    assertThatExceptionOfType(error.getClass())
            .isThrownBy(() -> underTest.call(() -> {
                throw error;
            }))
            .withMessage(exceptionMessage)
            .withNoCause();
    Mockito.verify(logger).error(expectedLogMessage, error);
}