@Test
void exceptionHandlingOnRegistration() {

    final ShutdownHook.Handler h = mock(ShutdownHook.Handler.class);
    doThrow(new IllegalStateException("Testing exception")).when(h)
        .get();
    assertThat(new ShutdownHook().register(h)).isFalse();
}