@Test(expected = IllegalStateException.class)
public void testAddBufferFull() throws IOException {

  GenericTransportSerializer serializer = mock(GenericTransportSerializer.class);
  doReturn("foo".getBytes()).when(serializer).serialize(any(InternalEvent.class));
  GenericTransportBuffer buffer = new GenericTransportBuffer(1, false, serializer);
  InternalEvent mockEvent = mock(InternalEvent.class);
  buffer.add(mockEvent);
  buffer.add(mockEvent);
}