ComponentTypeIndex { public Optional<Class<? extends Component>> find(ResourceUrn urn) { return Optional.ofNullable(componentIndexByUrn.get(urn)); } ComponentTypeIndex(ResolutionStrategy resolutionStrategy); @Deprecated  ComponentTypeIndex(ModuleEnvironment environment);  ComponentTypeIndex(ModuleEnvironment environment, ResolutionStrategy resolutionStrategy); void changeEnvironment(ModuleEnvironment environment); Optional<Class<? extends Component>> find(ResourceUrn urn); Optional<Class<? extends Component>> find(Name name, Name moduleContext); Optional<Class<? extends Component>> find(Name name); Optional<Class<? extends Component>> find(String identity);  }
@Test public void findComponentWithStringUrn() { assertEquals(Optional.of(Sample.class), index.find("Test:Sample")); }
@Test public void findComponentWithNameAlone() { assertEquals(Optional.of(Sample.class), index.find(new Name("Sample"))); }
@Test public void findComponentWithStringName() { assertEquals(Optional.of(Sample.class), index.find("Sample")); }
@Test public void findComponentWithFullUrn() { assertEquals(Optional.of(Sample.class), index.find(new ResourceUrn("Test:Sample"))); }