class XACMLPrivilegeUtils {

    public static PolicySet addPolicyToPolicySet(Policy policy,
            PolicySet policySet)
            throws JAXBException {
        if (policySet == null || policy == null) {
            return policySet;
        }
        JAXBContext jaxbContext = JAXBContext.newInstance(
                XACMLConstants.XACML3_CORE_PKG);

        List<JAXBElement<?>> pList
                = policySet.getPolicySetOrPolicyOrPolicySetIdReference();
        JAXBElement<Policy> policyElement = objectFactory.createPolicy(policy);
        pList.add(policyElement);
        return policySet;
    }

    private  XACMLPrivilegeUtils();

}