@Test
	void testReceivedHeader() throws Exception {
		final int BUF_SIZE = 10000;
		final int offset = 10;
		final ByteArrayInputStream in = new ByteArrayInputStream("hello world".getBytes());
		try (ReceivedHeaderStream hdrIS
				= new ReceivedHeaderStream(in, "ehlo", InetAddress.getLocalHost(), "foo", null, "123", null)) {
			final byte[] buf = new byte[BUF_SIZE];
			final int len = hdrIS.read(buf, offset, BUF_SIZE - offset);

			final String result = new String(buf, offset, len);

			assertTrue(result.endsWith("\nhello world"));
		}
	}
This class tests a bug in ReceivedHeaderStream which has since been fixed.
src/test/java/de/gessnerfl/fakesmtp/smtp/ReceivedHeaderStreamTest.java