@Test
public void testConstructor() {

	DummyWriter dummyWriter = new DummyWriter();
	WriterOutputStream writerOutputStream = new WriterOutputStream(
		dummyWriter);
	Assert.assertSame(dummyWriter, _getWriter(writerOutputStream));
	Assert.assertSame(
		StringPool.DEFAULT_CHARSET_NAME, writerOutputStream.getEncoding());
	Assert.assertEquals(
		_getDefaultOutputBufferSize(),
		_getOutputBufferSize(writerOutputStream));
	Assert.assertFalse(_isAutoFlush(writerOutputStream));
	writerOutputStream = new WriterOutputStream(dummyWriter, null);
	Assert.assertSame(dummyWriter, _getWriter(writerOutputStream));
	Assert.assertSame(
		StringPool.DEFAULT_CHARSET_NAME, writerOutputStream.getEncoding());
	Assert.assertEquals(
		_getDefaultOutputBufferSize(),
		_getOutputBufferSize(writerOutputStream));
	Assert.assertFalse(_isAutoFlush(writerOutputStream));
	String encoding = "US-ASCII";
	writerOutputStream = new WriterOutputStream(dummyWriter, encoding);
	Assert.assertSame(dummyWriter, _getWriter(writerOutputStream));
	Assert.assertSame(encoding, writerOutputStream.getEncoding());
	Assert.assertEquals(
		_getDefaultOutputBufferSize(),
		_getOutputBufferSize(writerOutputStream));
	Assert.assertFalse(_isAutoFlush(writerOutputStream));
	writerOutputStream = new WriterOutputStream(
		dummyWriter, encoding, true);
	Assert.assertSame(dummyWriter, _getWriter(writerOutputStream));
	Assert.assertSame(encoding, writerOutputStream.getEncoding());
	Assert.assertEquals(
		_getDefaultOutputBufferSize(),
		_getOutputBufferSize(writerOutputStream));
	Assert.assertTrue(_isAutoFlush(writerOutputStream));
	writerOutputStream = new WriterOutputStream(dummyWriter, encoding, 32);
	Assert.assertSame(dummyWriter, _getWriter(writerOutputStream));
	Assert.assertSame(encoding, writerOutputStream.getEncoding());
	Assert.assertEquals(1, _getInputBufferSize(writerOutputStream));
	Assert.assertEquals(32, _getOutputBufferSize(writerOutputStream));
	Assert.assertFalse(_isAutoFlush(writerOutputStream));
	writerOutputStream = new WriterOutputStream(
		dummyWriter, encoding, 32, true);
	Assert.assertSame(dummyWriter, _getWriter(writerOutputStream));
	Assert.assertSame(encoding, writerOutputStream.getEncoding());
	Assert.assertEquals(1, _getInputBufferSize(writerOutputStream));
	Assert.assertEquals(32, _getOutputBufferSize(writerOutputStream));
	Assert.assertTrue(_isAutoFlush(writerOutputStream));
	writerOutputStream = new WriterOutputStream(
		dummyWriter, encoding, 0, true);
	Assert.assertSame(dummyWriter, _getWriter(writerOutputStream));
	Assert.assertSame(encoding, writerOutputStream.getEncoding());
	Assert.assertEquals(1, _getInputBufferSize(writerOutputStream));
	Assert.assertEquals(
		_getDefaultOutputBufferSize(),
		_getOutputBufferSize(writerOutputStream));
	Assert.assertTrue(_isAutoFlush(writerOutputStream));
	try {
		new WriterOutputStream(dummyWriter, encoding, 0, false);
		Assert.fail();
	}
	catch (IllegalArgumentException illegalArgumentException) {
		Assert.assertEquals(
			"Output buffer size 0 must be a positive number",
			illegalArgumentException.getMessage());
	}
}