public void testSelfReference() { try { MyBean lTest1 = new MyBean(); lTest1.setId(113); lTest1.setName("SELF-POINTING"); lTest1.setPtr(lTest1); MarshallValue lResult = marshall.unmarshall(marshall.marshall(lTest1)); Assert.assertTrue(MarshallValue.REFERENCE == lResult.getType()); MyBean lTest2 = (MyBean) lResult.getReference(); Assert.assertNotNull(lTest2); Assert.assertEquals(lTest2.getName(), "SELF-POINTING"); Assert.assertEquals(lTest2.getId(), 113); Assert.assertTrue(lTest2 == lTest2.getPtr()); } catch (Exception e) { Assert.fail(); } }