BindingDOMAdapterLoader extends AdapterLoader<BindingService, DOMService> { @Override protected final AdapterBuilder<? extends BindingService, DOMService> createBuilder( final Class<? extends BindingService> key) { final Factory<?> factory = FACTORIES.get(key); checkArgument(factory != null, "Unsupported service type %s", key); return factory.newBuilder(codec); } BindingDOMAdapterLoader(final AdapterContext codec);   }
@Test public void createBuilderTest() { assertTrue(bindingDOMAdapterLoader.load(DataBroker.class).get() instanceof BindingDOMDataBrokerAdapter); domService = null; assertFalse(bindingDOMAdapterLoader.load(DataBroker.class).isPresent()); }