@Override
          public int compare(Method method1, Method method2) {
            String m1Signature =
                method1.getDeclaringClass()
                    + method1.getName()
                    + Arrays.toString(method1.getParameterTypes())
                    + method1.getReturnType();
            String m2Signature =
                method2.getDeclaringClass()
                    + method2.getName()
                    + Arrays.toString(method2.getParameterTypes())
                    + method2.getReturnType();

            return m1Signature.compareTo(m2Signature);
          }
Generate a proxy class. Note that new instances of this class will not automatically have an an
invocation handler, even if {@link #handler(InvocationHandler)} was called. The handler must be
set on each instance after it is created, using {@link #setInvocationHandler(Object,
InvocationHandler)}.
android/android_framework/dex-maker/src/main/java/com/android/dx/stock/ProxyBuilder.java