### Question:
BasicBrooklynTypeRegistry implements BrooklynTypeRegistry { @Override public RegisteredType get(String symbolicName, String version) { return getSingle(symbolicName, version, null).orNull(); } BasicBrooklynTypeRegistry(ManagementContext mgmt); 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, Class<SpecT> specSuperType); @Override SpecT createSpecFromPlan(String planFormat, Object planData, RegisteredTypeLoadingContext optionalConstraint, Class<SpecT> optionalSpecSuperType); @Override T createBean(RegisteredType type, RegisteredTypeLoadingContext constraint, Class<T> optionalResultSuperType); @Override T createBeanFromPlan(String planFormat, Object planData, RegisteredTypeLoadingContext optionalConstraint, Class<T> optionalBeanSuperType); @Beta // API is stabilising void addToLocalUnpersistedTypeRegistry(RegisteredType type, boolean canForce);  }### Answer:
@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 ); }