LoggingSession implements InternalSessionContext { public synchronized void stopSession() { configuration.enableLoggingToStandardOutput(); state = state.changeTo(STOPPED); loggingSessionNotifier.stopSession(); } LoggingSession(final Configuration configuration,
      final LoggingSessionNotifier loggingSessionNotifier); static LoggingSession create(); synchronized void createSession(final LogConfigSupplier logConfigSupplier); synchronized void createSession(final LogConfigSupplier logConfigSupplier,
      final boolean logBanner, final boolean logConfiguration); synchronized void createSession(final LogConfigSupplier logConfigSupplier,
      final boolean logBanner, final boolean logConfiguration,
      final boolean standardOutputAlwaysOn); synchronized void startSession(); synchronized void stopSession(); synchronized void shutdown(); Optional<LogFile> getLogFile(); @Override State getState(); @Override LogConfigSupplier getLogConfigSupplier();  }
@Test public void stopSessionThrowsIfSessionNotCreated() { assertThatThrownBy(() -> loggingSession.stopSession()) .isInstanceOf(NullPointerException.class); }