### Question:
FaultBean { public WrapperBeanClass transform(final Class<?> exceptionClass, final String defaultPackage) { WrapperBeanClass jClass = new WrapperBeanClass(); if (isWebFaultAbsent(exceptionClass)) { jClass.setName(exceptionClass.getSimpleName() + "Bean"); jClass.setPackageName(defaultPackage); } else { jClass.setFullClassName(getWebFaultBean(exceptionClass)); } buildBeanFields(exceptionClass, jClass); String pkg = PackageUtils.getPackageName(exceptionClass); if (pkg.length() > 0) { jClass.setElementName(new QName(PackageUtils.getNamespace(pkg), exceptionClass.getSimpleName())); } else { jClass.setElementName(new QName(PackageUtils.getNamespace(ToolConstants.DEFAULT_PACKAGE_NAME), exceptionClass.getSimpleName())); } jClass.annotate(new WrapperBeanAnnotator(exceptionClass)); return jClass; }  boolean faultBeanExists(final Class<?> exceptionClass); WrapperBeanClass transform(final Class<?> exceptionClass, final String defaultPackage);  }### Answer:
@Test public void testTransform() throws Exception { Class<?> faultClass = Class.forName("org.apache.cxf.tools.fortest.cxf523.DBServiceFault"); FaultBean bean = new FaultBean(); WrapperBeanClass beanClass = bean.transform(faultClass, "org.apache.cxf.tools.fortest.cxf523.jaxws"); assertNotNull(beanClass); assertEquals("DBServiceFaultBean", beanClass.getName()); assertEquals("org.apache.cxf.tools.fortest.cxf523.jaxws", beanClass.getPackageName()); assertEquals(1, beanClass.getFields().size()); JavaField field = beanClass.getFields().get(0); assertEquals("message", field.getName()); assertEquals("java.lang.String", field.getType()); QName qname = beanClass.getElementName(); assertEquals("DBServiceFault", qname.getLocalPart()); assertEquals("http: }