// Path: benchmarks-api/src/main/java/uk/co/real_logic/benchmarks/remote/MessageTransceiver.java
// static final long CHECKSUM = ThreadLocalRandom.current().nextLong();


import org.HdrHistogram.Histogram;
import org.agrona.collections.MutableInteger;
import org.agrona.concurrent.NanoClock;
import org.junit.jupiter.api.Test;
import java.util.concurrent.ThreadLocalRandom;
import static java.lang.Long.MAX_VALUE;
import static java.lang.Long.MIN_VALUE;
import static org.junit.jupiter.api.Assertions.assertArrayEquals;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.mockito.Mockito.*;
import static uk.co.real_logic.benchmarks.remote.MessageTransceiverBase.CHECKSUM;
    void sendMultipleMessages()
    {
        final int result = messageTransceiver.send(4, 64, 800, -222);

        assertEquals(4, result);
    }

    @Test
    void sendReturnsZeroIfItCantFitAnEntireBatch()
    {
        messageTransceiver.send(InMemoryMessageTransceiver.SIZE, 8, 777, 100);

        final int result = messageTransceiver.send(1, 100, 555, 21);

        assertEquals(0, result);
    }

    @Test
    void receiveIsANoOpIfNothingWasWritten()
    {
        messageTransceiver.receive();

        verifyNoInteractions(clock, histogram);
    }

    @Test
    void receiveIsANoOpAfterAllMessagesWereConsumed()
    {
        when(clock.nanoTime()).thenReturn(1500L);

// Path: benchmarks-api/src/main/java/uk/co/real_logic/benchmarks/remote/MessageTransceiver.java
// static final long CHECKSUM = ThreadLocalRandom.current().nextLong();


// Path: benchmarks-api/src/test/java/uk/co/real_logic/benchmarks/remote/InMemoryMessageTransceiverTest.java
import org.HdrHistogram.Histogram;
import org.agrona.collections.MutableInteger;
import org.agrona.concurrent.NanoClock;
import org.junit.jupiter.api.Test;
import java.util.concurrent.ThreadLocalRandom;
import static java.lang.Long.MAX_VALUE;
import static java.lang.Long.MIN_VALUE;
import static org.junit.jupiter.api.Assertions.assertArrayEquals;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.mockito.Mockito.*;
import static uk.co.real_logic.benchmarks.remote.MessageTransceiverBase.CHECKSUM;

    void sendMultipleMessages()
    {
        final int result = messageTransceiver.send(4, 64, 800, -222);

        assertEquals(4, result);
    }

    @Test
    void sendReturnsZeroIfItCantFitAnEntireBatch()
    {
        messageTransceiver.send(InMemoryMessageTransceiver.SIZE, 8, 777, 100);

        final int result = messageTransceiver.send(1, 100, 555, 21);

        assertEquals(0, result);
    }

    @Test
    void receiveIsANoOpIfNothingWasWritten()
    {
        messageTransceiver.receive();

        verifyNoInteractions(clock, histogram);
    }

    @Test
    void receiveIsANoOpAfterAllMessagesWereConsumed()
    {
        when(clock.nanoTime()).thenReturn(1500L);

        messageTransceiver.send(5, 128, 1111, CHECKSUM);