### Question:
PermissionActions { public static <E extends Enum<E>> String getCanonicalActionString(EnumSet<E> set) { if (set == null || set.isEmpty()) return ""; final StringBuilder b = new StringBuilder(); getCanonicalActionString(set, b); return b.toString(); } private  PermissionActions(); static EnumSet<E> parseActionStringToSet(Class<E> actionType, String actionString); static int parseActionStringToInt(Class<E> actionType, String actionString); static long parseActionStringToLong(Class<E> actionType, String actionString); static String getCanonicalActionString(EnumSet<E> set); static void getCanonicalActionString(EnumSet<E> set, StringBuilder b); static String getCanonicalActionString(Class<E> type, int set); static void getCanonicalActionString(Class<E> type, int set, StringBuilder b); static String getCanonicalActionString(Class<E> type, long set); static void getCanonicalActionString(Class<E> type, long set, StringBuilder b);  }### Answer:
@Test public void testCanonicalActionString() { assertEquals("foo,bar,baz", getCanonicalActionString(EnumSet.allOf(ActionSetOne.class))); assertEquals("", getCanonicalActionString(EnumSet.noneOf(ActionSetOne.class))); assertEquals("foo", getCanonicalActionString(EnumSet.of(ActionSetOne.foo))); assertEquals("foo,baz", getCanonicalActionString(EnumSet.of(ActionSetOne.foo, ActionSetOne.baz))); }