[JBMAR-171] added test case to ensure object with writeObject does not throw NPE