@Test public void stringSetToEnumSet() { Set<String> stringSet = Sets.newHashSet(Arrays.asList("SELECT", "MODIFY")); Set<Permission> permissionSet = OperationFactory.toOperationSet(stringSet); assertThat(permissionSet).containsExactly(Permission.SELECT, Permission.MODIFY); }
static Set<Permission> toOperationSet(Set<String> permissionNames) { return permissionNames .stream() .map(String::trim) .map(Permission::valueOf) .collect(Collectors.toCollection(() -> EnumSet.noneOf(Permission.class))); }
OperationFactory { static Set<Permission> toOperationSet(Set<String> permissionNames) { return permissionNames .stream() .map(String::trim) .map(Permission::valueOf) .collect(Collectors.toCollection(() -> EnumSet.noneOf(Permission.class))); } }
OperationFactory { static Set<Permission> toOperationSet(Set<String> permissionNames) { return permissionNames .stream() .map(String::trim) .map(Permission::valueOf) .collect(Collectors.toCollection(() -> EnumSet.noneOf(Permission.class))); } private  OperationFactory(); }
OperationFactory { static Set<Permission> toOperationSet(Set<String> permissionNames) { return permissionNames .stream() .map(String::trim) .map(Permission::valueOf) .collect(Collectors.toCollection(() -> EnumSet.noneOf(Permission.class))); } private  OperationFactory();  }
OperationFactory { static Set<Permission> toOperationSet(Set<String> permissionNames) { return permissionNames .stream() .map(String::trim) .map(Permission::valueOf) .collect(Collectors.toCollection(() -> EnumSet.noneOf(Permission.class))); } private  OperationFactory();   }