PolicyIdConversions { public static String generateUniquePolicyId(String siteId, String policyName) { String subffix = String.format("_%s", siteId.toLowerCase()); if (policyName.toLowerCase().endsWith(subffix)) { return policyName; } return String.format("%s_%s", policyName, siteId.toLowerCase()); }  static String generateUniquePolicyId(String siteId, String policyName); static String parsePolicyId(String siteId, String policyName);  }
@Test public void testGenerateUniquePolicyId() { Assert.assertEquals("mock_policy_test", PolicyIdConversions.generateUniquePolicyId("test", "mock_policy")); }