### Question:
CorbaServerConduit implements Conduit { public void close(Message message) throws IOException { if (message instanceof CorbaMessage) { buildRequestResult((CorbaMessage)message); } message.getContent(OutputStream.class).close(); } CorbaServerConduit(EndpointInfo ei,
                              EndpointReferenceType ref,
                              org.omg.CORBA.Object targetObj,
                              ORB o,
                              OrbConfig config,
                              CorbaTypeMap map); void prepare(Message message); void close(Message message); EndpointReferenceType getTarget(); void close(); void setMessageObserver(MessageObserver observer); MessageObserver getMessageObserver(); final EndpointReferenceType getTargetReference(EndpointReferenceType t); final String getAddress(); void buildRequestResult(CorbaMessage msg);  }### Answer:
@Test public void testClose() throws Exception { Method m = CorbaServerConduit.class.getDeclaredMethod("buildRequestResult", new Class[] {CorbaMessage.class}); CorbaServerConduit conduit = EasyMock.createMockBuilder(CorbaServerConduit.class) .addMockedMethod(m) .createMock(); CorbaMessage msg = control.createMock(CorbaMessage.class); conduit.buildRequestResult(msg); EasyMock.expectLastCall(); OutputStream stream = control.createMock(OutputStream.class); EasyMock.expect(msg.getContent(OutputStream.class)).andReturn(stream); stream.close(); EasyMock.expectLastCall(); control.replay(); conduit.close(msg); control.verify(); }