private static Method method(Class<?> aClass, @NonNls String name, int parameters) throws Exception {
    for (Method method : aClass.getDeclaredMethods()) {
      if (method.getParameterCount() == parameters && name.equals(method.getName())) {
        method.setAccessible(true);
        return method;
      }
    }
    throw new NoSuchMethodException(name);
  }
private static Method method(Class<?> aClass, @NonNls String name, int parameters)