Add PrintWriterTest and add some buffer unit tests