### Question:
XACMLPrivilegeUtils { static List<Match> getAllMatchesFromTarget(Target target) { List<Match> matches = new ArrayList<Match>(); if (target != null) { List<AnyOf> anyOfList = target.getAnyOf(); for (AnyOf anyOf : anyOfList) { List<AllOf> allOfList = anyOf.getAllOf(); for (AllOf allOf : allOfList) { List<Match> matchList = allOf.getMatch(); matches.addAll(matchList); } } } return matches; } 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 getApplicationNameFromPolicy(Policy policy); static Set<String> getResourceNamesFromPolicy(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 Map<String, Boolean> getActionValuesFromPolicy(Policy policy); static EntitlementSubject getEntitlementSubjectFromPolicy(Policy policy); static EntitlementCondition getEntitlementConditionFromPolicy(Policy policy); 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); static void validate(Privilege privilege, PrivilegeValidator privilegeValidator); @VisibleForTesting static boolean containsUndesiredCharacters(String s);  }### Answer:
@Test public void shouldReturnEmptyListWhenNull() { List<Match> allMatchesFromTarget = XACMLPrivilegeUtils.getAllMatchesFromTarget(null); assertThat(allMatchesFromTarget).isNotNull().isEmpty(); }