package org.komamitsu.fluency.sender;

import java.io.IOException;
import java.nio.ByteBuffer;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.atomic.AtomicInteger;

public class MockTCPSender extends TCPSender
{
    private final List<ByteBuffer> events = new ArrayList<ByteBuffer>();
    private final AtomicInteger closeCount = new AtomicInteger();

    public MockTCPSender(String host, int port)
            throws IOException
    {
        super(host, port);
    }

    public MockTCPSender(int port)
            throws IOException
    {
        super(port);
    }

    @Override
    public synchronized void send(ByteBuffer data)
            throws IOException
    {
        events.add(data);
    }

    @Override
    public synchronized void close()
            throws IOException
    {
        closeCount.incrementAndGet();
    }

    public List<ByteBuffer> getEvents()
    {
        return events;
    }

    public AtomicInteger getCloseCount()
    {
        return closeCount;
    }
}

@@ -588,32 +588,184 @@
 r(port);%0A    %7D%0A%0A
+    @Override%0A    public synchronized void send(List%3CByteBuffer%3E dataList)%0A            throws IOException%0A    %7B%0A        events.addAll(dataList);%0A    %7D%0A%0A
     @Override%0A  

Fix unit test failure