code: @VisibleForTesting
      static Method getMethod(Class<?> cls, String name, Class<?>... params) {
          Method m;
          try {
              m = cls.getDeclaredMethod(name, params);
          } catch (Exception e) {
              throw new RuntimeException(e);
          }
          m.setAccessible(true);
          return m;
      }
docs: Bundle reflection calls to get access to the given method