### Question:
PrincipalClassifier { public static void classifyPrincipals(Set<String> principals, Set<String> patronPrincipals, Set<String> staffPrincipals) { principals.forEach(agent -> { if (PATRON_PRINC_PATTERN.matcher(agent).matches()) { patronPrincipals.add(agent); } else { staffPrincipals.add(agent); } }); } private  PrincipalClassifier(); static boolean isPatronPrincipal(String principal); static void classifyPrincipals(Set<String> principals, Set<String> patronPrincipals,
            Set<String> staffPrincipals); static Set<String> getPatronPrincipals(Set<String> principals);  }### Answer:
@Test public void classifyPrincipalsTest() { Set<String> principals = new HashSet<>(Arrays.asList(PUBLIC_PRINC, AUTHENTICATED_PRINC, STAFF_PRINC)); Set<String> patronPrincipals = new HashSet<>(); Set<String> staffPrincipals = new HashSet<>(); classifyPrincipals(principals, patronPrincipals, staffPrincipals); assertEquals(2, patronPrincipals.size()); assertTrue(patronPrincipals.contains(PUBLIC_PRINC)); assertTrue(patronPrincipals.contains(AUTHENTICATED_PRINC)); assertEquals(1, staffPrincipals.size()); assertTrue(staffPrincipals.contains(STAFF_PRINC)); }
@Test public void classifyPrincipalsNoPatronsTest() { Set<String> principals = new HashSet<>(Arrays.asList(STAFF_PRINC)); Set<String> patronPrincipals = new HashSet<>(); Set<String> staffPrincipals = new HashSet<>(); classifyPrincipals(principals, patronPrincipals, staffPrincipals); assertEquals(0, patronPrincipals.size()); assertEquals(1, staffPrincipals.size()); assertTrue(staffPrincipals.contains(STAFF_PRINC)); }