### Question:
ConversionUtils { public static String convertLegacyPermission(String permission) { final StringBuffer ret = new StringBuffer(); Matcher matcher = MATCHER_GROUP_PATTERN.matcher(permission); while (matcher.find()) { matcher.appendReplacement(ret, "{" + matcher.group(1).replace('|', ',') + "}"); } matcher.appendTail(ret); if (ret.length() > 2 && ret.substring(ret.length() - 2).equals(".*")) { ret.delete(ret.length() - 2, ret.length()); } return ret.toString(); }  static String convertLegacyPermission(String permission); @SuppressWarnings("unchecked") static T transfer(ImmutableSubjectData old, T newData);  }### Answer:
@Test public void testConvertPermission() { final Map<String, String> expectedConversions = ImmutableMap.of( "permissions.*", "permissions", "worldedit.navigation.(jumpto|thru).*", "worldedit.navigation.{jumpto,thru}", "worldedit.navigation.(jumpto|thru).(tool|command)", "worldedit.navigation.{jumpto,thru}.{tool,command}", "worldedit.navigation.(jumpto.*", "worldedit.navigation.(jumpto" ); for (Map.Entry<String, String> ent : expectedConversions.entrySet()) { assertEquals(ent.getValue(), ConversionUtils.convertLegacyPermission(ent.getKey())); } }