GenericTransportBuffer implements TransportBuffer { @Override public void close() { try { os.flush(); } catch (IOException e) { logger.warn("unable to flush os"); } try { os.close(); } catch (IOException e) { logger.warn("unable to close os"); } } 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 testDoubleClose() throws IOException, TransportException { GenericTransportSerializer serializer = mock(GenericTransportSerializer.class); GenericTransportBuffer buffer = new GenericTransportBuffer(1, true, serializer); buffer.close(); buffer.close(); }