### Question:
QosProtocolWrapper implements Protocol { @Override public <T> Invoker<T> refer(Class<T> type, URL url) throws RpcException { if (Constants.REGISTRY_PROTOCOL.equals(url.getProtocol())) { startQosServer(url); return protocol.refer(type, url); } return protocol.refer(type, url); } QosProtocolWrapper(Protocol protocol); @Override int getDefaultPort(); @Override Exporter<T> export(Invoker<T> invoker); @Override Invoker<T> refer(Class<T> type, URL url); @Override void destroy();  }### Answer:
@Test public void testRefer() throws Exception { wrapper.refer(BaseCommand.class, url); assertThat(server.isStarted(), is(true)); assertThat(server.getPort(), is(12345)); assertThat(server.isAcceptForeignIp(), is(false)); verify(protocol).refer(BaseCommand.class, url); }