GenericTransportBuffer implements TransportBuffer { @Override public boolean isEmpty() { return batchSize == 0; } GenericTransportBuffer(long maxBatchSize, boolean useCompression,
      TransportSerializer serializer); @Override boolean add(InternalEvent ievent); @Override ByteArrayOutputStream getInternalBuffer(); @Override boolean isEmpty(); @Override void close(); @Override void clear();  }
@Test public void testEmptyBuffer() throws IOException { GenericTransportSerializer serializer = mock(GenericTransportSerializer.class); doReturn("foo".getBytes()).when(serializer).serialize(any(InternalEvent.class)); GenericTransportBuffer buffer = new GenericTransportBuffer(1, false, serializer); assertEquals(true, buffer.isEmpty()); }