code: public static boolean hasCustomEquals(Class c)
      {
          Class origClass = c;
          if (_customEquals.containsKey(c))
          {
              return _customEquals.get(c);
          }
  
          while (!Object.class.equals(c))
          {
              try
              {
                  c.getDeclaredMethod("equals", Object.class);
                  _customEquals.put(origClass, true);
                  return true;
              }
              catch (Exception ignored) { }
              c = c.getSuperclass();
          }
          _customEquals.put(origClass, false);
          return false;
      }
docs: Determine if the passed in class has a non-Object.equals() method.  This
  method caches its results in static ConcurrentHashMap to benefit
  execution performance.
  @param c Class to check.
  @return true, if the passed in Class has a .equals() method somewhere between
  itself and just below Object in it's inheritance.