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();

}