@Test
public void testWriteObjectOrdinaryNPE() throws Exception {

	Serializer serializer = new Serializer();
	Serializable serializable = new Serializable() {
		private void writeObject(ObjectOutputStream objectOutputStream)
			throws IOException {
			throw new IOException("Forced IOException");
		}
	};
	try {
		serializer.writeObject(serializable);
		Assert.fail();
	}
	catch (RuntimeException runtimeException) {
		String message = runtimeException.getMessage();
		Assert.assertTrue(
			message.startsWith(
				"Unable to write ordinary serializable object "));
		Throwable throwable = runtimeException.getCause();
		Assert.assertTrue(throwable instanceof IOException);
		Assert.assertEquals("Forced IOException", throwable.getMessage());
	}
}