// the PAP
// root policy set
PolicySetType rootPAPPolicySet = papContainer.getRootPolicySet();
if (!(PolicySetHelper.hasPolicySetReferenceId(rootPAPPolicySet, pivotId))) {
throw new RepositoryException("Id not found or not a resource-id: " + pivotId);
}
if (!(PolicySetHelper.deletePolicySetReference(rootPAPPolicySet, id))) {
throw new RepositoryException(String.format("Id \"%s\" not found into resource \"%s\"",
id,
rootPAPPolicySet.getPolicySetId()));
}
int pivotIndex = PolicySetHelper.getPolicySetIdReferenceIndex(rootPAPPolicySet, pivotId);