public static void checkProxyMethod(Object proxy,Method method){
  if (proxy == null || !Proxy.isProxyClass(proxy.getClass())) {
    throw new IllegalArgumentException("Not a Proxy instance");
  }
  if (Modifier.isStatic(method.getModifiers())) {
    throw new IllegalArgumentException("Can't handle static method");
  }
  Class<?> c=method.getDeclaringClass();
  if (c == Object.class) {
    String name=method.getName();
    if (name.equals("hashCode") || name.equals("equals") || name.equals("toString")) {
      return;
    }
  }
  if (isSuperInterface(proxy.getClass(),c)) {
    return;
  }
  throw new IllegalArgumentException("Can't handle: " + method);
}

public static void checkProxyMethod ( Object proxy , Method method ) { if ( proxy == null || ! Proxy . isProxyClass ( proxy . getClass ( ) ) ) { throw new IllegalArgumentException ( "Not a Proxy instance" ) ; } if ( Modifier . isStatic ( method . getModifiers ( ) ) ) { throw new IllegalArgumentException ( "Can't handle static method" ) ; } Class < ? > c = method . getDeclaringClass ( ) ; if ( c == Object . class ) { String name = method . getName ( ) ; if ( name . equals ( "hashCode" ) || name . equals ( "equals" ) || name . equals ( "toString" ) ) { return ; } } if ( isSuperInterface ( proxy . getClass ( ) , c ) ) { return ; } throw new IllegalArgumentException ( "Can't handle: " + method ) ; }
check if the given method is a method declared in the proxy interface implemented by the given proxy instance .
