### Question:
FaultBeanGenerator extends BeanGenerator { protected Set<Class<?>> getExceptionClasses(final Method method) { Set<Class<?>> exps = new HashSet<>(); final Class<?>[] exceptionClasses = method.getExceptionTypes(); for (int i = 0; i < exceptionClasses.length; i++) { boolean exclude = false; Class<?> exClazz = exceptionClasses[i]; if (exClazz.equals(Exception.class) || Fault.class.isAssignableFrom(exClazz) || exClazz.equals(RuntimeException.class) || exClazz.equals(Throwable.class) || exClazz.equals(RemoteException.class) || exClazz.equals(ServerException.class)) { continue; } Method[] expMethods = exClazz.getMethods(); for (Method expMethod : expMethods) { if ("getFaultInfo".equals(expMethod.getName())) { exclude = true; break; } } if (exclude) { continue; } exps.add(exClazz); } return exps; }    }### Answer:
@Test public void testGetExceptionClasses() throws Exception { Class<?> seiClass = Class.forName("org.apache.hello_world.Greeter"); FaultBeanGenerator generator = new FaultBeanGenerator(); Set<Class<?>> classes = new HashSet<>(); for (Method method : seiClass.getMethods()) { classes.addAll(generator.getExceptionClasses(method)); } assertEquals(0, classes.size()); classes.clear(); seiClass = Class.forName("org.apache.cxf.tools.fortest.cxf523.Database"); for (Method method : seiClass.getMethods()) { classes.addAll(generator.getExceptionClasses(method)); } assertEquals(1, classes.size()); assertEquals("org.apache.cxf.tools.fortest.cxf523.DBServiceFault", classes.iterator().next().getName()); }