code: private Method exactMethod(String name, Class<?>[] types) throws NoSuchMethodException {
          Class<?> t = type();
  
          // first priority: find a public method with exact signature match in class hierarchy
          try {
              return t.getMethod(name, types);
          }
  
          // second priority: find a private method with exact signature match on declaring class
          catch (NoSuchMethodException e) {
              do {
                  try {
                      return t.getDeclaredMethod(name, types);
                  }
                  catch (NoSuchMethodException ignore) {}
  
                  t = t.getSuperclass();
              }
              while (t != null);
  
              throw new NoSuchMethodException();
          }
      }
docs: Searches a method with the exact same signature as desired.
  <p>
  If a public method is found in the class hierarchy, this method is returned.
  Otherwise a private method with the exact same signature is returned.
  If no exact match could be found, we let the {@code NoSuchMethodException} pass through.