docs: public static Comparable canonicalizeForHashLookup(Comparable value) {
          Class clazz = value.getClass();
          assert value instanceof Number;
  
          Number number = (Number) value;
  
          if (isDoubleRepresentable(clazz)) {
              double doubleValue = number.doubleValue();
              long longValue = number.longValue();
  
              if (equalDoubles(doubleValue, (double) longValue)) {
                  return longValue;
              } else if (clazz == Float.class) {
                  return doubleValue;
              }
          } else if (isLongRepresentableExceptLong(clazz)) {
              return number.longValue();
          }
  
          return value;
      }