@@ -0,0 +1,2945 @@
+package com.logcapture.example;%0A%0Aimport org.junit.Test;%0Aimport org.slf4j.Logger;%0Aimport org.slf4j.LoggerFactory;%0A%0Aimport java.util.concurrent.CompletableFuture;%0A%0Aimport static ch.qos.logback.classic.Level.INFO;%0Aimport static com.logcapture.LogCapture.captureLogEvents;%0Aimport static com.logcapture.LogCapture.captureLogEventsAsync;%0Aimport static com.logcapture.assertion.ExpectedLoggedException.logException;%0Aimport static com.logcapture.assertion.ExpectedLoggingMessage.aMessage;%0Aimport static com.logcapture.matcher.exception.ExceptionCauseMatcher.causeOf;%0Aimport static com.logcapture.matcher.exception.ExceptionCauseMessageMatcher.whereCauseMessage;%0Aimport static java.time.Duration.ofSeconds;%0Aimport static org.assertj.core.api.Assertions.assertThat;%0Aimport static org.hamcrest.Matchers.*;%0A%0Apublic class ExampleShould %7B%0A  private final Logger log = LoggerFactory.getLogger(ExampleShould.class);%0A%0A  @Test%0A  public void verify_captured_events() %7B%0A    captureLogEvents(() -%3E log.info(%22a message%22))%0A      .logged(aMessage()%0A        .withLevel(equalTo(INFO))%0A        .withMessage(equalTo(%22a message%22)));%0A  %7D%0A%0A  @Test%0A  public void verify_captured_events_having_assertions_as_result() %7B%0A    captureLogEvents(() -%3E %7B%0A      log.info(%22a message%22);%0A      return %22aResult%22;%0A    %7D)%0A      .assertions((result) -%3E assertThat(result).isEqualTo(%22aResult%22))%0A      .logged(aMessage()%0A        .info()%0A        .withMessage(%22a message%22));%0A  %7D%0A%0A  @Test%0A  public void verify_captured_events_async_with_assertions() %7B%0A    captureLogEventsAsync(() -%3E CompletableFuture.supplyAsync(() -%3E %7B%0A      log.info(%22a message%22);%0A      return %22aResult%22;%0A    %7D))%0A      .waitAtMost(ofSeconds(1), aMessage()%0A        .withLevel(equalTo(INFO))%0A        .withMessage(equalTo(%22a message%22)))%0A      .assertions(result -%3E assertThat(result).isCompletedWithValue(%22aResult%22));%0A  %7D%0A%0A  @Test%0A  public void verify_captured_events_with_exception() %7B%0A    RuntimeException exception = new RuntimeException();%0A%0A    captureLogEvents(() -%3E log.error(%22message%22, exception))%0A      .logged(aMessage()%0A        .havingException(logException()%0A          .withException(isA(RuntimeException.class))%0A        ));%0A  %7D%0A%0A  @Test%0A  public void verify_captured_events_with_exception_cause_message() %7B%0A    RuntimeException exception = new RuntimeException(new IllegalStateException(%22Some state is invalid%22));%0A    captureLogEvents(() -%3E log.error(%22message%22, exception))%0A      .logged(aMessage()%0A        .havingException(logException()%0A          .withException(whereCauseMessage(containsString(%22state is invalid%22)))%0A        ));%0A  %7D%0A%0A  @Test%0A  public void verify_captured_events_with_exception_cause() %7B%0A    RuntimeException exception = new RuntimeException(new IllegalStateException(%22Some state is invalid%22));%0A    captureLogEvents(() -%3E log.error(%22message%22, exception))%0A      .logged(aMessage()%0A        .havingException(logException()%0A          .withException(causeOf(IllegalStateException.class))%0A        ));%0A  %7D%0A%7D%0A

Add an example test.