public static <@NonNull E> CompletableSource resolveScopeFromLifecycle(
      final LifecycleScopeProvider<E> provider) throws OutsideScopeException {
    return resolveScopeFromLifecycle(provider, true);
  }
@Test
  public void resolveScopeFromLifecycle_normal_comparable() {
    PublishSubject<NegativeComparableInteger> lifecycle = PublishSubject.create();

    TestObserver<?> o =
        testSource(resolveScopeFromLifecycle(lifecycle, new NegativeComparableInteger(3)));

    lifecycle.onNext(new NegativeComparableInteger(-1));
    o.assertNoErrors().assertNotComplete();
    lifecycle.onNext(new NegativeComparableInteger(-2));
    o.assertNoErrors().assertNotComplete();
    lifecycle.onNext(new NegativeComparableInteger(3));
    o.assertNoErrors().assertNotComplete();

    // Now we end
    lifecycle.onNext(new NegativeComparableInteger(-3));
    o.assertComplete();
  }