private Set<RoleAuthorization> createUnmodifiableSet(Set<RoleAuthorization> set) {
    return (set == null)
        ? Collections.emptySet()
        : Collections.unmodifiableSet(new HashSet<>(set));
  }
Safely create an unmodifiable set of RoleAuthorizations

@param set the set to copy
@return an unmodifiable set of RoleAuthorizations
ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AbstractAuthorizedResourceProvider.java