### Question:
DelegationUtils { static String swapRealmTag(String realm, String value) { return value.replace(REALM_NAME_TAG, realm); }  static void createRealmPrivileges(SSOToken token, String realmName); static void copyRealmPrivilegesFromParent(SSOToken token,
            OrganizationConfigManager parent, OrganizationConfigManager child); static void deleteRealmPrivileges(SSOToken token, String realmName);  }### Answer:
@Test public void testSwapRealmTagWithREALMInName() throws Exception { String realm = "o=aREALM,ou=services,dc=openam,dc=forgerock,dc=org"; String result = DelegationUtils.swapRealmTag(realm, VALUE); Assert.assertEquals(result, "*o=aREALM,ou=services,dc=openam,dc=forgerock,dc=org/*"); }
@Test public void testSwapRealmTagWithREALMInSubRealmName() throws Exception { String realm = "o=aSUBREALM,o=aREALM,ou=services,dc=openam,dc=forgerock,dc=org"; String result = DelegationUtils.swapRealmTag(realm, VALUE); Assert.assertEquals(result, "*o=aSUBREALM,o=aREALM,ou=services,dc=openam,dc=forgerock,dc=org/*"); }