MessageFramer { public void close() { if (!isClosed()) { closed = true; if (buffer != null && buffer.readableBytes() == 0) { releaseBuffer(); } commitToSink(true, true); } } MessageFramer(Sink sink, WritableBufferAllocator bufferAllocator); void writePayload(InputStream message); void flush(); boolean isClosed(); void close(); void dispose();  }
@Test public void closeWithoutBufferedFrameGivesNullBuffer() { framer.close(); verify(sink).deliverFrame(null, true, true); verifyNoMoreInteractions(sink); assertEquals(0, allocator.allocCount); }