### Question:
DomainProfileManager { public Predicate<String> isDefinitionIdAllowed(final Metadata metadata) { return getDefinitionProfile(metadata) .map(DomainProfile::definitionAllowedFilter) .orElse(defaultProfile.definitionAllowedFilter()); } @Inject  DomainProfileManager(final DefinitionManager definitionManager,
                                final ProfileManager profileManager,
                                final FullProfile defaultProfile); List<String> getAllDefinitions(final Metadata metadata); Predicate<String> isDefinitionIdAllowed(final Metadata metadata);  }### Answer:
@Test public void testIsDefinitionAllowed() { when(metadata.getProfileId()).thenReturn(DEFAULT_PROFILE.getProfileId()); assertTrue(tested.isDefinitionIdAllowed(metadata).test(DEF1)); assertTrue(tested.isDefinitionIdAllowed(metadata).test(DEF2)); when(metadata.getProfileId()).thenReturn(PROFILE_DOMAIN_ID); assertTrue(tested.isDefinitionIdAllowed(metadata).test(DEF1)); assertFalse(tested.isDefinitionIdAllowed(metadata).test(DEF2)); }