### Question:
BackendQuery { public static <T> T runIfAlive(final Callable<T> task, final Supplier<Boolean> alive) throws Exception { return runIfAlive(Optional.empty(), task, alive); }  static T runIfAlive(final Callable<T> task, final Supplier<Boolean> alive); static T runIfAlive(
      final String taskName, final Callable<T> task, final Supplier<Boolean> alive); static T runIfAlive(
      final Optional<String> taskName, final Callable<T> task, final Supplier<Boolean> alive); static void stopIfExpired(final Supplier<Boolean> alive);  }### Answer:
@Test public void test() throws Exception { if (wantException) { assertThatThrownBy(() -> BackendQuery.runIfAlive(() -> wantReturn, alive)) .isInstanceOf(wantExceptionClass) .hasMessage(wantExceptionMessage); } else { assertThat(BackendQuery.runIfAlive(() -> wantReturn, alive)).isEqualTo(wantReturn); } }