public HealthCheck.Result check(Callable<HealthCheck.Result> c) {
        try {
            return executorService.submit(c).get(duration.getQuantity(), duration.getUnit());
        } catch (InterruptedException e) {
            Thread.currentThread().interrupt();
        } catch (Exception ignored) {
        }
        return unhealthy();
    }
@Test
    @SuppressWarnings("unchecked")
    void testCheck() throws InterruptedException, ExecutionException, TimeoutException {
        final ExecutorService executorService = mock(ExecutorService.class);
        final Duration duration = mock(Duration.class);
        when(duration.getQuantity()).thenReturn(5L);
        when(duration.getUnit()).thenReturn(TimeUnit.SECONDS);

        final Callable<HealthCheck.Result> callable = mock(Callable.class);
        final Future<HealthCheck.Result> future = mock(Future.class);
        when(executorService.submit(callable)).thenReturn(future);

        new TimeBoundHealthCheck(executorService, duration).check(callable);
        verify(executorService, times(1)).submit(callable);
        verify(future, times(1)).get(duration.getQuantity(), duration.getUnit());
    }