### Question:
PermissionsBuilder { Set<String> getCustomPermissions(final String type, final String identifier) { final Set<String> profileSinglePermissions = new HashSet<>(); final Set<String> customPermissionsForEntity = getCustomPermissionsRaw(type, identifier); for (final String customPermissionForEntity : customPermissionsForEntity) { final Set<String> simplePermissions = getCompoundPermissions(customPermissionForEntity); if (!simplePermissions.isEmpty()) { profileSinglePermissions.addAll(simplePermissions); } else { profileSinglePermissions.add(customPermissionForEntity); } } return profileSinglePermissions; } PermissionsBuilder(final APISession session, final ProfileAPI profileAPI,
            final ApplicationAPI applicationAPI, final CustomPermissionsMapping customPermissionsMapping,
            final CompoundPermissionsMapping compoundPermissionsMapping); Set<String> getPermissions(); static final String PROFILE_TYPE_AUTHORIZATION_PREFIX; static final String USER_TYPE_AUTHORIZATION_PREFIX; }### Answer:
@Test public void should_getCustomPermissions_work_with_compound_permissions() { doReturn(aSet("Perm1", "Perm2", "taskListing")).when(customPermissionsMapping).getPropertyAsSet("user|myUser"); doReturn(aSet("Perm3", "Perm4")).when(compoundPermissionsMapping).getPropertyAsSet("taskListing"); final Set<String> permissions = permissionsBuilder.getCustomPermissions("user", "myUser"); assertThat(permissions).containsOnly("Perm1","Perm2","Perm3","Perm4"); }