1   package ch.qos.logback.classic.pattern;
2   
3   import ch.qos.logback.classic.spi.ILoggingEvent;
4   import ch.qos.logback.core.pattern.CompositeConverter;
5   
6   import static org.junit.jupiter.api.Assertions.assertNull;
7   
8   public class XCompositeConverter extends CompositeConverter<ILoggingEvent> {
9   
10      void assertNoNext() {
11          assertNull( this.getNext(), "converter instance has next element");
12      }
13  
14      @Override
15      protected String transform(ILoggingEvent event, String in) {
16          if (event.getMessage().contains("assert"))
17              assertNoNext();
18          return "";
19      }
20  
21  }