code: private static void removeMethodByName(Method method, List<Method> methods) {
      if(methods != null) {
        Iterator<Method> itr = methods.iterator();
        Method aMethod = null;
        while(itr.hasNext()) {
          aMethod = itr.next();
          if(aMethod.getName().equals(method.getName())) {
            itr.remove();
            break;
          }
        }
        if(aMethod != null) {
          methods.add(aMethod);
        }
      }
    }
docs: Removes a method from the given list and adds it to the end of the list.
  @param method
  @param methods