public CorrespondingEventsFunction correspondingEvents()

in autodispose-lifecycle/src/main/java/autodispose2/lifecycle/TestLifecycleScopeProvider.java [64:75]


  public CorrespondingEventsFunction<TestLifecycle> correspondingEvents() {
    return testLifecycle -> {
      switch (testLifecycle) {
        case STARTED:
          return TestLifecycle.STOPPED;
        case STOPPED:
          throw new LifecycleEndedException();
        default:
          throw new IllegalStateException("Unknown lifecycle event.");
      }
    };
  }