code: public static <T> Set<T> createIfNull(Set<T> currentValue) {
          if (currentValue == null) {
              return new HashSet<>();
          } else {
              return currentValue;
          }
      }
docs: Returns a new empty set if the passed array is null.