protected static <E, T> HiveMethodDispatcher<T, E> createMethodDispatcher(
      final Class<T> returnClazz,
      final ReflectiveVisitor visitor,
      final String methodName,
      final Class<E> arg0Clazz,
      final Class... otherArgClasses) {
    final List<Class> otherArgClassList =
        ImmutableList.copyOf(otherArgClasses);
    final VisitDispatcher<ReflectiveVisitor, E> dispatcher =
        createDispatcher((Class<ReflectiveVisitor>) visitor.getClass(), arg0Clazz);
    return new HiveMethodDispatcher<>(dispatcher, returnClazz, visitor, methodName,
        arg0Clazz, otherArgClassList);
  }
Creates a dispatcher for calls to a single multi-method on a particular
object.

<p>Calls to that multi-method are resolved by looking for a method on
the runtime type of that object, with the required name, and with
the correct type or a subclass for the first argument, and precisely the
same types for other arguments.

<p>For instance, a dispatcher created for the method

<blockquote>String foo(Vehicle, int, List)</blockquote>

<p>could be used to call the methods

<blockquote>String foo(Car, int, List)<br>
String foo(Bus, int, List)</blockquote>

<p>(because Car and Bus are subclasses of Vehicle, and they occur in the
polymorphic first argument) but not the method

<blockquote>String foo(Car, int, ArrayList)</blockquote>

<p>(only the first argument is polymorphic).

<p>You must create an implementation of the method for the base class.
Otherwise throws {@link IllegalArgumentException}.

@param returnClazz     Return type of method
@param visitor         Object on which to invoke the method
@param methodName      Name of method
@param arg0Clazz       Base type of argument zero
@param otherArgClasses Types of remaining arguments
ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/rules/HiveReflectUtil.java