@Test
    public void testSurrogatePairsMixedWithSingleCharacters() throws java.io.IOException {
        stream.reset();
        ByteWriter b = new ByteWriter(stream, encoder);
        b.write(0x00F8);
        b.write(0xD800);
        b.write(0xDFD0);
        b.write(0x00F8);
        b.write(0xD800);
        b.write((int) 'a');
        b.write(0xDFD0);
        b.write((int) 'b');
        b.close();
        assertArrayEquals(Utf8.toBytes("\u00F8\uD800\uDFD0\u00F8ab"), stream.toByteArray());
    }
A stream which does nothing, but complains if it is called and asked to
do nothing.
vespajlib/src/test/java/com/yahoo/io/ByteWriterTestCase.java