### Question:
JAXRSClientFactoryBean extends AbstractJAXRSFactoryBean { public <T> T create(Class<T> cls, Object... varValues) { return cls.cast(createWithValues(varValues)); } JAXRSClientFactoryBean();  JAXRSClientFactoryBean(JAXRSServiceFactoryBean serviceFactory); void setClassLoader(ClassLoader loader); void setThreadSafe(boolean threadSafe); void setSecondsToKeepState(long time); String getUsername(); void setUsername(String username); String getPassword(); void setPassword(String password); void setInheritHeaders(boolean ih); void setResourceClass(Class<?> cls); void setServiceClass(Class<?> cls); Class<?> getServiceClass(); void setHeaders(Map<String, String> map); Map<String, List<String>> getHeaders(); WebClient createWebClient(); T create(Class<T> cls, Object... varValues); Client create(); Client createWithValues(Object... varValues); void setInitialState(ClientState initialState);  }### Answer:
@Test public void testComplexProxy() throws Exception { IProductResource productResource = JAXRSClientFactory.create("http: IProductResource.class); assertNotNull(productResource); IPartsResource parts = productResource.getParts(); assertNotNull(parts); IProductResource productResourceElement = parts.elementAt("1"); assertNotNull(productResourceElement); }
@Test public void testVoidResponseAcceptWildcard() throws Exception { String address = "local: JAXRSServerFactoryBean sf = new JAXRSServerFactoryBean(); sf.setServiceBean(new BookStore()); sf.setAddress(address); Server s = sf.create(); BookStore store = JAXRSClientFactory.create(address, BookStore.class); store.addBook(new Book()); s.stop(); ResponseImpl response = (ResponseImpl) WebClient.client(store).getResponse(); Map<String, List<String>> headers = CastUtils.cast((Map<?, ?>) response.getOutMessage().get(Message.PROTOCOL_HEADERS)); assertTrue(headers.get(HttpHeaders.ACCEPT).contains(MediaType.WILDCARD)); }
@Test public void testCreateClientWithUserResource() throws Exception { JAXRSClientFactoryBean bean = new JAXRSClientFactoryBean(); bean.setAddress("http: UserResource r = new UserResource(); r.setName(BookStore.class.getName()); r.setPath("/"); UserOperation op = new UserOperation(); op.setName("getDescription"); op.setVerb("GET"); r.setOperations(Collections.singletonList(op)); bean.setModelBeans(r); assertTrue(bean.create() instanceof BookStore); }