PermissionUtil { public static PermissionSet computeBasePermissions(PermissionSet everyonePerms, List<PermissionSet> rolePerms) { return rolePerms.stream().reduce(everyonePerms, PermissionSet::or); }  static PermissionSet computeBasePermissions(PermissionSet everyonePerms, List<PermissionSet> rolePerms); static PermissionSet computePermissions(PermissionSet base, @Nullable PermissionOverwrite everyoneOverwrite,
                                                   List<PermissionOverwrite> roleOverwrites,
                                                   @Nullable PermissionOverwrite memberOverwrite);  }
@Test public void testComputeBase() { PermissionSet everyonePerms = PermissionSet.of(SEND_MESSAGES); List<PermissionSet> rolePerms = Arrays.asList(PermissionSet.of(BAN_MEMBERS, PRIORITY_SPEAKER), PermissionSet.of(MANAGE_ROLES)); PermissionSet actual = PermissionUtil.computeBasePermissions(everyonePerms, rolePerms); PermissionSet expected = PermissionSet.of(SEND_MESSAGES, BAN_MEMBERS, PRIORITY_SPEAKER, MANAGE_ROLES); assertEquals(expected, actual); }