@Test
public void testWrite() {

    writer.write("fo");
    writer.write("o\n");
    writer.increaseIndent();
    writer.write("bar");
    writer.close();
    assertEquals("foo\nbar", new String(stream.toByteArray()));
}