FooWireBuilder fooBuilder = new FooWireBuilder();
BarWireBuilder barBuilder = new BarWireBuilder();
DefaultWireBuilder defaultBuilder = new DefaultWireBuilder();
defaultBuilder.addWireBuilder(fooBuilder);
defaultBuilder.addWireBuilder(barBuilder);
TargetWireFactory targetFooFactory = new JDKTargetWireFactory();
Map<Method, TargetInvocationConfiguration> fooConfigs = new HashMap<Method, TargetInvocationConfiguration>();
TargetInvocationConfiguration fooInvocation = new TargetInvocationConfiguration(m);
fooConfigs.put(m, fooInvocation);
Map<Method, TargetInvocationConfiguration> barConfigs = new HashMap<Method, TargetInvocationConfiguration>();
TargetInvocationConfiguration barInvocation = new TargetInvocationConfiguration(m);
barConfigs.put(m, barInvocation);
targetFooFactory.setConfiguration(new WireTargetConfiguration(null, fooConfigs, null, null));
TargetWireFactory targetBarFactory = new JDKTargetWireFactory();
targetBarFactory.setConfiguration(new WireTargetConfiguration(null, barConfigs, null, null));
ScopeContext ctx = new MockScopeContext();
defaultBuilder.completeTargetChain(targetFooFactory, FooContextFactory.class, ctx);
defaultBuilder.completeTargetChain(targetBarFactory, BarContextFactory.class, ctx);
assertEquals(FooInvoker.class, targetFooFactory.getConfiguration().getInvocationConfigurations().get(m).getTargetInvoker().getClass());
assertEquals(BarInvoker.class, targetBarFactory.getConfiguration().getInvocationConfigurations().get(m).getTargetInvoker().getClass());
}