@Test public void shouldBeAbleToProvideAFruitButNotAJuice() { this.picoContainer.addComponent(Fruit.class); assertThat(container.canProvide(Fruit.class), is(true)); assertThat(container.canProvide(Juice.class), is(false)); }
public <T> boolean canProvide(Class<T> type) { return instanceFor(type) != null; }
PicoBasedContainer implements Container { public <T> boolean canProvide(Class<T> type) { return instanceFor(type) != null; } }
PicoBasedContainer implements Container { public <T> boolean canProvide(Class<T> type) { return instanceFor(type) != null; } PicoBasedContainer(MutablePicoContainer container); }
PicoBasedContainer implements Container { public <T> boolean canProvide(Class<T> type) { return instanceFor(type) != null; } PicoBasedContainer(MutablePicoContainer container); T instanceFor(Class<T> type); boolean canProvide(Class<T> type); MutablePicoContainer getContainer(); }
PicoBasedContainer implements Container { public <T> boolean canProvide(Class<T> type) { return instanceFor(type) != null; } PicoBasedContainer(MutablePicoContainer container); T instanceFor(Class<T> type); boolean canProvide(Class<T> type); MutablePicoContainer getContainer();  }