final ServiceLocator locator = ServerLocatorFactory.createLocator();
final String propValue = "bar";
WadlGeneratorConfig config = WadlGeneratorConfig.generator(MyWadlGenerator.class).
prop("foo", propValue).
build();
WadlGenerator wadlGenerator = config.createWadlGenerator(locator);
Assert.assertEquals(MyWadlGenerator.class, wadlGenerator.getClass());
Assert.assertEquals(((MyWadlGenerator) wadlGenerator).getFoo(), propValue);
final String propValue2 = "baz";
config = WadlGeneratorConfig.generator(MyWadlGenerator.class).
prop("foo", propValue).generator(MyWadlGenerator2.class).
prop("bar", propValue2).
build();
wadlGenerator = config.createWadlGenerator(locator);
Assert.assertEquals(MyWadlGenerator2.class, wadlGenerator.getClass());
final MyWadlGenerator2 wadlGenerator2 = (MyWadlGenerator2) wadlGenerator;
Assert.assertEquals(wadlGenerator2.getBar(), propValue2);
Assert.assertEquals(MyWadlGenerator.class, wadlGenerator2.getDelegate().getClass());
Assert.assertEquals(((MyWadlGenerator) wadlGenerator2.getDelegate()).getFoo(), propValue);