code: public static boolean areEqual(Object value1, Object value2) {
          return ((value1 == null) && (value2 == null)) || //
                  (isNaN(value1) && isNaN(value2)) || //
                  ((value1 != null) && value1.equals(value2));
      }
docs: Compares the two given values by taking null and NaN values into account.
  <p>
  Two null values will be considered equal. Two NaN values (either Double or Float) will be considered equal.
  
  @param value1 First value.
  @param value2 Second value.
  
  @return True if both values are equal or if both are null.