### Question:
RMEndpoint { void createService(ProtocolVariation protocol) { ServiceInfo si = new ServiceInfo(); si.setProperty(Schema.class.getName(), getSchema()); QName serviceQName = new QName(protocol.getWSRMNamespace(), SERVICE_NAME); si.setName(serviceQName); buildInterfaceInfo(si, protocol); WrappedService service = new WrappedService(applicationEndpoint.getService(), serviceQName, si); DataBinding dataBinding = null; Class<?> create = protocol.getCodec().getCreateSequenceType(); try { JAXBContext ctx = JAXBContext.newInstance(PackageUtils.getPackageName(create), create.getClassLoader()); dataBinding = new JAXBDataBinding(ctx); } catch (JAXBException e) { throw new ServiceConstructionException(e); } service.setDataBinding(dataBinding); service.setInvoker(servant); services.put(protocol, service); } RMEndpoint(RMManager m, Endpoint ae); RMManager getManager(); Endpoint getApplicationEndpoint(); Endpoint getEndpoint(ProtocolVariation protocol); Service getService(ProtocolVariation protocol); BindingInfo getBindingInfo(ProtocolVariation protocol); Proxy getProxy(); Servant getServant(); Destination getDestination(); void setDestination(Destination destination); Source getSource(); void setSource(Source source); long getLastApplicationMessage(); int getApplicationMessageCount(); void receivedApplicationMessage(); long getLastControlMessage(); int getControlMessageCount(); void receivedControlMessage(); Conduit getConduit(); RMConfiguration getConfiguration(); void handleAccept(String ssid, long number, Message msg); void handleAcknowledgment(String ssid, long number, Message msg);  }### Answer:
@Test public void testCreateService() { Service as = control.createMock(Service.class); EasyMock.expect(ae.getService()).andReturn(as); control.replay(); rme.createServices(); Service s = rme.getService(ProtocolVariation.RM10WSA200408); assertNotNull(s); WrappedService ws = (WrappedService)s; assertSame(as, ws.getWrappedService()); assertSame(rme.getServant(), s.getInvoker()); verifyService(); }