@Nullable public static Method findMethod(Class c,String name,Object... params){
  Class[] paramTypes=getParamTypes(params);
  Method method=null;
  try {
    method=c.getDeclaredMethod(name,paramTypes);
  }
 catch (  NoSuchMethodException e) {
    try {
      method=c.getMethod(name,paramTypes);
    }
 catch (    NoSuchMethodException e1) {
    }
  }
  if (method != null)   method.setAccessible(true);
  return method;
}

@ Nullable public static Method findMethod ( Class c , String name , Object ... params ) { Class [ ] paramTypes = getParamTypes ( params ) ; Method method = null ; try { method = c . getDeclaredMethod ( name , paramTypes ) ; } catch ( NoSuchMethodException e ) { try { method = c . getMethod ( name , paramTypes ) ; } catch ( NoSuchMethodException e1 ) { } } if ( method != null ) method . setAccessible ( true ) ; return method ; }
searches for a method by its name and arguments .
