### Question:
BasicBrooklynTypeRegistry implements BrooklynTypeRegistry { @SuppressWarnings("deprecation") @Override public Iterable<RegisteredType> getMatching(Predicate<? super RegisteredType> filter) { return Iterables.filter(Iterables.concat( getAllWithoutCatalog(filter), Iterables.transform(mgmt.getCatalog().getCatalogItems(), RegisteredTypes.CI_TO_RT)), filter); } 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 testGetWithFilter() { add(SAMPLE_TYPE); Assert.assertEquals( Iterables.size(registry().getMatching(Predicates.and( RegisteredTypePredicates.symbolicName(SAMPLE_TYPE.getSymbolicName()), RegisteredTypePredicates.subtypeOf(String.class) ))), 1 ); Assert.assertTrue( Iterables.isEmpty(registry().getMatching(Predicates.and( RegisteredTypePredicates.symbolicName(SAMPLE_TYPE.getSymbolicName()), RegisteredTypePredicates.subtypeOf(Integer.class) ))) ); }