### Question:
CorbaObjectWriter { public void writeObjectReference(CorbaObjectReferenceHandler objHandler) throws CorbaBindingException { stream.write_Object(objHandler.getReference()); } CorbaObjectWriter(OutputStream outStream); void write(CorbaObjectHandler obj); void writeBoolean(Boolean b); void writeChar(Character c); void writeWChar(Character c); void writeOctet(Byte b); void writeShort(Short s); void writeUShort(Integer s); void writeLong(Integer l); void writeULong(Long l); void writeLongLong(Long l); void writeULongLong(java.math.BigInteger l); void writeFloat(Float f); void writeDouble(Double d); void writeString(String s); void writeWString(String s); void writeAny(CorbaAnyHandler anyHandler); void writeEnum(CorbaEnumHandler enumHandler); void writeStruct(CorbaStructHandler structHandler); void writeException(CorbaExceptionHandler exHandler); void writeFixed(CorbaFixedHandler fixedHandler); void writeUnion(CorbaObjectHandler obj); void writeArray(CorbaArrayHandler arrayHandler); void writeSequence(CorbaObjectHandler obj); void writeObjectReference(CorbaObjectReferenceHandler objHandler);  }### Answer:
@Test public void testWriteObject() throws IOException { URL refUrl = getClass().getResource("/references/account.ref"); String oRef = IOUtils.toString(refUrl.openStream()).trim(); org.omg.CORBA.Object objRef = orb.string_to_object(oRef); assertNotNull(objRef); org.apache.cxf.binding.corba.wsdl.Object objectType = new org.apache.cxf.binding.corba.wsdl.Object(); objectType.setRepositoryID("IDL:Account:1.0"); objectType.setBinding(new QName("AccountCORBABinding")); QName objectName = new QName("TestObject"); QName objectIdlType = new QName("corbaatm:TestObject"); TypeCode objectTC = orb.create_interface_tc("IDL:Account:1.0", "TestObject"); CorbaObjectReferenceHandler obj = new CorbaObjectReferenceHandler(objectName, objectIdlType, objectTC, objectType); obj.setReference(objRef); OutputStream oStream = orb.create_output_stream(); CorbaObjectWriter writer = new CorbaObjectWriter(oStream); writer.writeObjectReference(obj); InputStream iStream = oStream.create_input_stream(); org.omg.CORBA.Object resultObj = iStream.read_Object(); assertTrue(resultObj._is_equivalent(obj.getReference())); }