FluentInterfaceGenerator { public static void run (File[] source, File target, InterfaceGenerator config) { new FluentInterfaceGenerator(source, config).write(target); } private  FluentInterfaceGenerator(File[] source, InterfaceGenerator config); static void run(File[] source, File target, InterfaceGenerator config);  }
@Test public void testRun() throws Exception { File src = new File("./src/test/java"); File target = new File("./target/test-out1/"); File schema = new File("./src/main/resources/schema/interfaces.xsd"); File xml = new File("./src/test/xml/ColorInterfaces.xml"); Source xmlSrc = new StreamSource(xml); JAXBContext ctx = JAXBContext.newInstance(InterfaceGenerator.class); Unmarshaller um = ctx.createUnmarshaller(); SchemaFactory sf = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI); um.setSchema(sf.newSchema(schema)); InterfaceGenerator config = um.unmarshal(xmlSrc, InterfaceGenerator.class).getValue(); FluentInterfaceGenerator.run(new File[]{src}, target, config); }