private static Method getDeclaredMethodByName(Class<?> aClass, String methodName) throws NoSuchMethodException {
    for (Method method : aClass.getDeclaredMethods()) {
      if (methodName.equals(method.getName())) {
        method.setAccessible(true);
        return method;
      }
    }
    throw new NoSuchMethodException(aClass.getName() + "." + methodName);
  }
private static Method getDeclaredMethodByName(Class<?> aClass, String methodName)