static <T, R> CheckedFunction<T, R> decorateCheckedFunction(Observation observation,
                                                                CheckedFunction<T, R> function) {
        return (T t) -> observation.observeChecked(() -> function.apply(t));
    }
@Test
    public void shouldDecorateCheckedFunctionAndReturnWithSuccess() throws Throwable {
        given(helloWorldService.returnHelloWorldWithNameWithException("Tom"))
            .willReturn("Hello world Tom");
        CheckedFunction<String, String> function = Observations.decorateCheckedFunction(observation,
            helloWorldService::returnHelloWorldWithNameWithException);

        String result = function.apply("Tom");

        assertThat(result).isEqualTo("Hello world Tom");
        assertThatObservationWasStartedAndFinishedWithoutErrors();
        then(helloWorldService).should().returnHelloWorldWithNameWithException("Tom");
    }