@Test public void shouldBeAbleToInstantiateADependentBean() { this.picoContainer.addComponent(Fruit.class); this.picoContainer.addComponent(Juice.class); Fruit fruit = container.instanceFor(Fruit.class); Juice juice = container.instanceFor(Juice.class); assertThat(juice, is(notNullValue())); assertThat(juice.fruit, is(equalTo(fruit))); }
public <T> T instanceFor(Class<T> type) { return container.getComponent(type); }
PicoBasedContainer implements Container { public <T> T instanceFor(Class<T> type) { return container.getComponent(type); } }
PicoBasedContainer implements Container { public <T> T instanceFor(Class<T> type) { return container.getComponent(type); } PicoBasedContainer(MutablePicoContainer container); }
PicoBasedContainer implements Container { public <T> T instanceFor(Class<T> type) { return container.getComponent(type); } PicoBasedContainer(MutablePicoContainer container); T instanceFor(Class<T> type); boolean canProvide(Class<T> type); MutablePicoContainer getContainer(); }
PicoBasedContainer implements Container { public <T> T instanceFor(Class<T> type) { return container.getComponent(type); } PicoBasedContainer(MutablePicoContainer container); T instanceFor(Class<T> type); boolean canProvide(Class<T> type); MutablePicoContainer getContainer();  }