docs: public static Class commonClass(Class c1, Class c2)
      {
          if (c1 == c2)
          {
              return c1;
          }
  
          if ((c1 == Object.class) || c1.isAssignableFrom(c2))
          {
              return c1;
          }
  
          if (c2.isAssignableFrom(c1))
          {
              return c2;
          }
  
          if (c1.isPrimitive() || c2.isPrimitive())
          {
              // REVISIT: we could try to autoconvert to Object or something appropriate
              throw new IllegalArgumentException("incompatible types " + c1 + " and " + c2);
          }
  
          // REVISIT: we could try to find a common supper class or interface
          return Object.class;
      }