// Path: src/test/java/com/cisco/cta/taxii/adapter/IsEventContaining.java
// public static void verifyLog(Appender<ILoggingEvent> mockAppender, final String substring) {
//     verify(mockAppender, atLeastOnce())
//             .doAppend(argThat(isEventContaining(substring)));
// }


import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import ch.qos.logback.core.Appender;
import org.slf4j.MDC;
import static com.cisco.cta.taxii.adapter.IsEventContaining.verifyLog;
import static org.hamcrest.Matchers.is;
import static org.junit.Assert.assertThat;
import static org.mockito.Mockito.only;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.verifyZeroInteractions;
import java.io.Writer;
import org.junit.Before;
import org.junit.Test;
import org.mockito.Mock;
import org.mockito.MockitoAnnotations;
import org.mockito.Spy;
        char[] chars = "PAYLOAD".toCharArray();
        writer.write(chars);
        verifyZeroInteractions(logger);
        verifyZeroInteractions(statistics);
        writer.close();
    }

    @Test
    public void writeFinishedLine() throws Exception {
        char[] chars = "PAYLOAD\n".toCharArray();
        writer.write(chars);
        verify(logger, only()).info("PAYLOAD");
        assertThat(statistics.getLogs(), is(1L));
        writer.close();
    }

    @Test
    public void ignoreCharactersOutsideBoundaries() throws Exception {
        char[] chars = "beforePAYLOAD\nafter\nend".toCharArray();
        writer.write(chars, 6, 8);
        verify(logger, only()).info("PAYLOAD");
        assertThat(statistics.getLogs(), is(1L));
        writer.close();
    }

    @Test
    public void logErrorOnClosingBeforeFinishedLine() throws Exception {
        char[] chars = "PAYLOAD\nend".toCharArray();
        writer.write(chars);
        writer.close();
// Path: src/test/java/com/cisco/cta/taxii/adapter/IsEventContaining.java
// public static void verifyLog(Appender<ILoggingEvent> mockAppender, final String substring) {
//     verify(mockAppender, atLeastOnce())
//             .doAppend(argThat(isEventContaining(substring)));
// }


// Path: src/test/java/com/cisco/cta/taxii/adapter/Slf4JWriterTest.java
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import ch.qos.logback.core.Appender;
import org.slf4j.MDC;
import static com.cisco.cta.taxii.adapter.IsEventContaining.verifyLog;
import static org.hamcrest.Matchers.is;
import static org.junit.Assert.assertThat;
import static org.mockito.Mockito.only;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.verifyZeroInteractions;
import java.io.Writer;
import org.junit.Before;
import org.junit.Test;
import org.mockito.Mock;
import org.mockito.MockitoAnnotations;
import org.mockito.Spy;

        char[] chars = "PAYLOAD".toCharArray();
        writer.write(chars);
        verifyZeroInteractions(logger);
        verifyZeroInteractions(statistics);
        writer.close();
    }

    @Test
    public void writeFinishedLine() throws Exception {
        char[] chars = "PAYLOAD\n".toCharArray();
        writer.write(chars);
        verify(logger, only()).info("PAYLOAD");
        assertThat(statistics.getLogs(), is(1L));
        writer.close();
    }

    @Test
    public void ignoreCharactersOutsideBoundaries() throws Exception {
        char[] chars = "beforePAYLOAD\nafter\nend".toCharArray();
        writer.write(chars, 6, 8);
        verify(logger, only()).info("PAYLOAD");
        assertThat(statistics.getLogs(), is(1L));
        writer.close();
    }

    @Test
    public void logErrorOnClosingBeforeFinishedLine() throws Exception {
        char[] chars = "PAYLOAD\nend".toCharArray();
        writer.write(chars);
        writer.close();
        verifyLog(mockAppender, "unfinished");