@Nullable public static PsiMethod findMethodByName(PsiClass clazz,String name){
  PsiMethod[] methods=clazz.getMethods();
  for (int i=methods.length - 1; i >= 0; i--) {
    PsiMethod method=methods[i];
    if (name.equals(method.getName())) {
      return method;
    }
  }
  return null;
}

@ Nullable public static PsiMethod findMethodByName ( PsiClass clazz , String name ) { PsiMethod [ ] methods = clazz . getMethods ( ) ; for ( int i = methods . length - 1 ; i >= 0 ; i -- ) { PsiMethod method = methods [ i ] ; if ( name . equals ( method . getName ( ) ) ) { return method ; } } return null ; }
finds an existing method with the given name . if there isn ' t a method with the name , null is returned .
