### Question:
PermissionsBuilder { void addPagesOfApplication(final String profile, final Set<String> pageTokens) { final List<String> allPagesForProfile = applicationAPI.getAllPagesForProfile(profile); pageTokens.addAll(allPagesForProfile); } 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 testAddPagesOfApplication() { Set<String> permissions = aSet("Perm1", "Perm2"); doReturn(asList("Perm3", "Perm4")).when(applicationAPI).getAllPagesForProfile("myProfile1"); doReturn(asList("Perm4", "Perm5")).when(applicationAPI).getAllPagesForProfile("myProfile2"); permissionsBuilder.addPagesOfApplication("myProfile1", permissions); permissionsBuilder.addPagesOfApplication("myProfile2", permissions); assertThat(permissions).containsOnly("Perm1", "Perm2", "Perm3", "Perm4", "Perm5"); }