### Question:
FactoryHelper { public static Object findFactory(String factoryId, String defaultImpl) throws PreProcessFailedException { CodeGenClassLoader classLoader = null; try { ClassLoader parent = Thread.currentThread().getContextClassLoader().getParent(); if(parent instanceof CodeGenClassLoader) { classLoader = (CodeGenClassLoader) parent; } } catch (Exception exception) { throw new PreProcessFailedException(exception.getMessage(), exception); } try { String systemProp = System.getProperty( factoryId ); if( systemProp!=null) { return newInstance(factoryId, systemProp, classLoader); } } catch (Exception exception) { } FileInputStream in = null; try { String javah=System.getProperty( "java.home" ); String configFile = javah + File.separator + "lib" + File.separator + "ebaysoa.properties"; File f=new File( configFile ); if( f.exists()) { Properties props=new Properties(); in = new FileInputStream(f); props.load(in); String factoryClassName = props.getProperty(factoryId); return newInstance(factoryId, factoryClassName, classLoader); } } catch(Exception exception) { } finally { CodeGenUtil.closeQuietly(in); } if (defaultImpl == null) { throw new PreProcessFailedException("Provider for " + factoryId + " cannot be found"); } return newInstance(factoryId, defaultImpl, classLoader); }  static Object findFactory(String factoryId, String defaultImpl);  }### Answer:
@Test public void testFindFactory() throws Exception { String factoryId = WSDLFactory.class.getName(); String defaultImpl = WSDLFactoryImpl.class.getName(); Object factory = FactoryHelper.findFactory(factoryId, defaultImpl); Assert.assertNotNull("factory", factory); }