### Question:
Proxy { Object invoke(OperationInfo oi, ProtocolVariation protocol, Object[] params, Map<String, Object> context, Exchange exchange) throws RMException { return invoke(oi, protocol, params, context, exchange, Level.SEVERE); } Proxy(RMEndpoint rme); CreateSequenceResponseType createSequence(EndpointReferenceType defaultAcksTo, RelatesToType relatesTo,
             boolean isServer, final ProtocolVariation protocol, final Exchange exchange, Map<String, Object> context);  }### Answer:
@Test public void testInvoke() throws Exception { Method m = Proxy.class.getDeclaredMethod("createClient", new Class[] {Bus.class, Endpoint.class, ProtocolVariation.class, Conduit.class, org.apache.cxf.ws.addressing.EndpointReferenceType.class}); Proxy proxy = EasyMock.createMockBuilder(Proxy.class) .addMockedMethod(m).createMock(control); proxy.setReliableEndpoint(rme); RMManager manager = control.createMock(RMManager.class); EasyMock.expect(rme.getManager()).andReturn(manager).anyTimes(); Bus bus = control.createMock(Bus.class); EasyMock.expect(manager.getBus()).andReturn(bus).anyTimes(); Endpoint endpoint = control.createMock(Endpoint.class); EasyMock.expect(rme.getEndpoint(ProtocolVariation.RM10WSA200408)).andReturn(endpoint).anyTimes(); BindingInfo bi = control.createMock(BindingInfo.class); EasyMock.expect(rme.getBindingInfo(ProtocolVariation.RM10WSA200408)).andReturn(bi).anyTimes(); Conduit conduit = control.createMock(Conduit.class); EasyMock.expect(rme.getConduit()).andReturn(conduit).anyTimes(); org.apache.cxf.ws.addressing.EndpointReferenceType replyTo = control.createMock(org.apache.cxf.ws.addressing.EndpointReferenceType.class); EasyMock.expect(rme.getReplyTo()).andReturn(replyTo).anyTimes(); OperationInfo oi = control.createMock(OperationInfo.class); BindingOperationInfo boi = control.createMock(BindingOperationInfo.class); EasyMock.expect(bi.getOperation(oi)).andReturn(boi).anyTimes(); Client client = control.createMock(Client.class); EasyMock.expect(client.getRequestContext()).andReturn(new HashMap<String, Object>()).anyTimes(); EasyMock.expect(proxy.createClient(bus, endpoint, ProtocolVariation.RM10WSA200408, conduit, replyTo)) .andReturn(client).anyTimes(); Object[] args = new Object[] {}; Map<String, Object> context = new HashMap<>(); Object[] results = new Object[] {"a", "b", "c"}; Exchange exchange = control.createMock(Exchange.class); EasyMock.expect(client.invoke(boi, args, context, exchange)).andReturn(results).anyTimes(); control.replay(); assertEquals("a", proxy.invoke(oi, ProtocolVariation.RM10WSA200408, args, context, exchange)); }