class GrantRevokeIndex {

    boolean hasPermissions(final Collection<String> subjectIds, final Collection<String> permissions) {
        final Optional<Integer> grantWeight = grantMap.getMaxNonemptyWeightForAllPermissions(subjectIds, permissions);
        final Optional<Integer> revokeWeight = revokeMap.getMaxWeightForAllPermissions(subjectIds, permissions);

        return grantWeight.isPresent() && (!revokeWeight.isPresent() || revokeWeight.get() < grantWeight.get());
    }

      GrantRevokeIndex();
      GrantRevokeIndex(final PermissionSubjectsMap grantMap, final PermissionSubjectsMap revokeMap);

}