public static void rethrowIfUnrecoverable(Throwable exception) {
        if (exception instanceof OutOfMemoryError) {
            ExceptionUtils.throwAsUncheckedException(exception);
        }
    }
@Test
    void rethrowsOutOfMemoryError() {
        assertThrows(OutOfMemoryError.class, () -> rethrowIfUnrecoverable(new OutOfMemoryError()));
    }