public void testDependencyInOtherChild() throws Exception {
// Test one of the "weird" behaviors in Guice. Foo depends on Bar and Baz. Because
// Bar is bound in a sibling, we can't create Bar in the parent. Therefore,
// we create Bar (and Foo) in the origin
GinjectorBindings root = createInjectorNode("root");
GinjectorBindings childL = createInjectorNode("childL");
GinjectorBindings childR = createInjectorNode("childR");
setChildren(root, childL, childR);
bind(baz(), root);
bind(bar(), childL);
expect(root.isBoundLocallyInChild(bar())).andReturn(true).anyTimes();
Binding fooBinding = expectCreateBinding(foo(), required(foo(), bar()), required(foo(), baz()));
Binding barBinding = expectCreateBinding(bar());
childR.addBinding(bar(), barBinding);
expectParentBinding(baz(), root, childR);
childR.addBinding(foo(), fooBinding);
replayAndResolve(childR, required(Dependency.GINJECTOR, foo()));
}