public static <T> Set<T> nullToEmptySet(Set<T> newValue) {
    if (newValue == null) {
      return new HashSet<>();
    }
    return newValue;
  }
public static < T > Set < T > nullToEmptySet ( Set < T > newValue ) { if ( newValue == null ) { return new HashSet < > ( ) ; } return newValue ; }
Returns an empty set if the newValue is null

@param newValue - a set
@param <T>      - any type
@return non-null set