### Question:
OperationFactory { static String toOperationNameCsv(Set<Permission> operations) { return operations.stream() .map(Permission::name) .collect(Collectors.joining(",")); } private  OperationFactory();   }### Answer:
@Test public void enumSetToCsv() { Set<Permission> enumSet = Sets.immutableEnumSet(Permission.EXECUTE, Permission.ALTER); String csv = OperationFactory.toOperationNameCsv(enumSet); assertThat(csv).isEqualTo("ALTER,EXECUTE"); }
@Test public void emptyEnumSetToCsv() { Set<Permission> enumSet = Collections.emptySet(); String csv = OperationFactory.toOperationNameCsv(enumSet); assertThat(csv).isEqualTo(""); }