### Question:
DomainProfileManager { public List<String> getAllDefinitions(final Metadata metadata) { return getDefinitionsByProfile(metadata.getDefinitionSetId(), metadata.getProfileId()); } @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 testGetAllDefinitions() { when(metadata.getProfileId()).thenReturn(DEFAULT_PROFILE.getProfileId()); List<String> allDefinitions = tested.getAllDefinitions(metadata); assertEquals(2, allDefinitions.size()); assertTrue(allDefinitions.contains(DEF1)); assertTrue(allDefinitions.contains(DEF2)); when(metadata.getProfileId()).thenReturn(PROFILE_DOMAIN_ID); List<String> domainDefinitions = tested.getAllDefinitions(metadata); assertEquals(1, domainDefinitions.size()); assertTrue(domainDefinitions.contains(DEF1)); assertFalse(domainDefinitions.contains(DEF2)); }