BasicBrooklynTypeRegistry implements BrooklynTypeRegistry { @Override public RegisteredType get(String symbolicName, String version) { return getSingle(symbolicName, version, null).orNull(); } BasicBrooklynTypeRegistry(ManagementContext mgmt); @Override Iterable<RegisteredType> getAll(); @SuppressWarnings("deprecation") @Override Iterable<RegisteredType> getMatching(Predicate<? super RegisteredType> filter); @Override RegisteredType get(String symbolicName, String version); @Override RegisteredType get(String symbolicNameWithOptionalVersion, RegisteredTypeLoadingContext context); @Override Maybe<RegisteredType> getMaybe(String symbolicNameWithOptionalVersion, RegisteredTypeLoadingContext context); @Override RegisteredType get(String symbolicNameWithOptionalVersion); @Override SpecT createSpec(RegisteredType type, @Nullable RegisteredTypeLoadingContext constraint, @Nullable Class<SpecT> specSuperType); @Override SpecT createSpecFromPlan(@Nullable String planFormat, Object planData, @Nullable RegisteredTypeLoadingContext optionalConstraint, @Nullable Class<SpecT> optionalSpecSuperType); @Override T createBean(RegisteredType type, @Nullable RegisteredTypeLoadingContext constraint, @Nullable Class<T> optionalResultSuperType); @Override T createBeanFromPlan(String planFormat, Object planData, @Nullable RegisteredTypeLoadingContext optionalConstraint, @Nullable Class<T> optionalSuperType); @Override T create(RegisteredType type, @Nullable RegisteredTypeLoadingContext constraint, @Nullable Class<T> optionalResultSuperType); @Override T createFromPlan(RegisteredTypeKind kind, @Nullable String planFormat, Object planData, @Nullable RegisteredTypeLoadingContext optionalConstraint, @Nullable Class<T> superTypeHint); @Beta // API is stabilising void addToLocalUnpersistedTypeRegistry(RegisteredType type, boolean canForce); @Beta // API stabilising void delete(VersionedName type); void delete(RegisteredType type); @Beta // API stabilising void delete(String id); void clear(); @Beta void storeCatalogUpgradesInstructions(CatalogUpgrades catalogUpgrades); @Beta CatalogUpgrades getCatalogUpgradesInstructions();  }
@Test public void testGetWithContext() { add(SAMPLE_TYPE); Assert.assertEquals( registry().get(SAMPLE_TYPE.getId(), RegisteredTypeLoadingContexts.bean(String.class)), SAMPLE_TYPE ); Assert.assertEquals( registry().get(SAMPLE_TYPE.getId(), RegisteredTypeLoadingContexts.bean(Integer.class)), null ); }