### Question:
CorbaConduit implements Conduit { public NamedValue getReturn(CorbaMessage message) { if (orb == null) { prepareOrb(); } CorbaStreamable retVal = message.getStreamableReturn(); NamedValue ret = null; if (retVal != null) { Any returnAny = CorbaAnyHelper.createAny(orb); retVal.getObject().setIntoAny(returnAny, retVal, false); ret = orb.create_named_value(retVal.getName(), returnAny, org.omg.CORBA.ARG_OUT.value); } else { ret = orb.create_named_value("return", orb.create_any(), org.omg.CORBA.ARG_OUT.value); } return ret; } CorbaConduit(EndpointInfo ei, EndpointReferenceType ref, OrbConfig config); OrbConfig getOrbConfig(); synchronized void prepareOrb(); void prepare(Message message); void close(Message message); EndpointReferenceType getTarget(); void close(); void setMessageObserver(MessageObserver observer); final EndpointReferenceType getTargetReference(EndpointReferenceType t); final String getAddress(); void buildRequest(CorbaMessage message, OperationType opType); NVList getArguments(CorbaMessage message); NamedValue getReturn(CorbaMessage message); ExceptionList getExceptionList(Map<TypeCode, RaisesType> exceptions,
                                             CorbaMessage message,
                                             OperationType opType); Request getRequest(CorbaMessage message,
                                 String opName,
                                 org.omg.CORBA.NVList nvlist,
                                 org.omg.CORBA.NamedValue ret,
                                 org.omg.CORBA.ExceptionList exList); Map<TypeCode, RaisesType> getOperationExceptions(
                                         OperationType operation,
                                         CorbaTypeMap map); MessageObserver getMessageObserver();  }### Answer:
@Test public void testBuildReturn() throws Exception { Message msg = new MessageImpl(); CorbaMessage message = new CorbaMessage(msg); QName objName = new QName("returnName"); QName objIdlType = new QName(CorbaConstants.NU_WSDL_CORBA, "short", CorbaConstants.NP_WSDL_CORBA); TypeCode objTypeCode = orb.get_primitive_tc(TCKind.tk_short); CorbaPrimitiveHandler obj1 = new CorbaPrimitiveHandler(objName, objIdlType, objTypeCode, null); CorbaStreamable arg = message.createStreamableObject(obj1, objName); CorbaConduit conduit = setupCorbaConduit(false); NamedValue ret = conduit.getReturn(message); assertNotNull("Return should not be null", ret != null); assertEquals("name should be equal", ret.name(), "return"); message.setStreamableReturn(arg); NamedValue ret2 = conduit.getReturn(message); assertNotNull("Return2 should not be null", ret2 != null); assertEquals("name should be equal", ret2.name(), "returnName"); }