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();  }
@Test public void shouldBeAbleToProvideAFruitButNotAJuice() { this.picoContainer.addComponent(Fruit.class); assertThat(container.canProvide(Fruit.class), is(true)); assertThat(container.canProvide(Juice.class), is(false)); }