  @Test
  public void lifecycleCheckEnd_shouldFailIfEndedWithThrowingHandler() {

    TestLifecycleScopeProvider lifecycle = TestLifecycleScopeProvider.createInitial(STOPPED);

    final RuntimeException expected = new RuntimeException("Expected");
    AutoDisposePlugins.setOutsideScopeHandler(
        e -> {
          // Throw it back
          throw expected;
        });

    testSource(resolveScopeFromLifecycle(lifecycle, true)).assertError(expected);
  }