code: public static int nonNegativeHash(Object obj) {
      if (obj == null) { return 0; }
      int hash = obj.hashCode();
      return hash != Integer.MIN_VALUE ? Math.abs(hash) : 0;
    }
docs: Returns a hash consistent with Spark's Utils.nonNegativeHash().