### Question:
XACMLPrivilegeUtils { public static boolean isReferralPolicy(Policy policy) { String s = getVariableById(policy, XACMLConstants.IS_REFERRAL_POLICY); return XACMLConstants.XS_BOOLEAN_TRUE.equalsIgnoreCase(s); } private  XACMLPrivilegeUtils(); static String toXACML(Privilege privilege); static String toXML(Policy policy); static String toXML(PolicySet policySet); static void writeXMLToStream(PolicySet policySet, OutputStream outputStream); static Policy privilegeToPolicy(Privilege privilege); static String privilegeNameToPolicyId(String privilegeName,
            String applicationName); static List<AnyOf> entitlementSubjectToAnyOfList(
            EntitlementSubject es); static AnyOf entitlementSubjectToAnyOf(
            EntitlementSubject es); static List<AnyOf> resourceNamesToAnyOfList(
            Set<String> resourceNames, String applicationName); static AnyOf applicationNameToAnyOf(String applicationName); static List<AnyOf> actionNamesToAnyOfList(
            Set<String> actionNames, String applicationName); static Match resourceNameToMatch(String resourceName,
            String applicationName); static Match resourceNameToNotMatch(String resourceName,
            String applicationName); static Match actionNameToMatch(String actionName,
            String applicationName); static Match applicationNameToMatch(String applicationName); static Condition eSubjectConditionToXCondition(
            EntitlementSubject es, EntitlementCondition ec); static String getRuleCombiningAlgId(String applicationName); static Set<Privilege> policySetToPrivileges(PolicySet policySet); static Privilege policyToPrivilege(Policy policy); static String policyIdToPrivilegeName(String policyId); static String getVariableById(Policy policy, String id); static PolicySet privilegesToPolicySet(String realm, Collection<Privilege> privileges); static PolicySet newPolicySet(String realm); static PolicySet addPolicyToPolicySet(Policy policy,
            PolicySet policySet); static PolicySet streamToPolicySet(InputStream stream); static Set<Policy> getPoliciesFromPolicySet(PolicySet policySet); static Policy referralToPolicy(ReferralPrivilege privilege); static Policy referralToPolicyInternal(ReferralPrivilege privilege); static boolean isReferralPolicy(Policy policy); static ReferralPrivilege policyToReferral(Policy policy); static AnyOf realmsAppsResourcesToAnyOf(Set<String> realms,
            Map<String, Set<String>> appsResources);  }### Answer:
@Test public void shouldIndicateReferralPolicyWhenGivenReferralPrivilege() throws EntitlementException, JSONException { Policy policy = getArbitraryReferralPrivilegeAsPolicy(now); boolean answer = XACMLPrivilegeUtils.isReferralPolicy(policy); assertTrue(answer, "Expected Policy to be reported as a ReferralPolicy"); }
@Test public void shouldIndicateNotAReferralPolicyWhenGivenPolicy() throws EntitlementException { Policy policy = getArbitraryPrivilegeAsPolicy(now); boolean answer = XACMLPrivilegeUtils.isReferralPolicy(policy); assertFalse(answer, "Expected Policy to be reported as not a ReferralPolicy"); }