code: private Method exactMethod(String name, Class<?>[] types) throws NoSuchMethodException {
          final Class<?> type = type();
  
          // first priority: find a public method with exact signature match in class hierarchy
          try {
              return type.getMethod(name, types);
          }
  
          // second priority: find a private method with exact signature match on declaring class
          catch (NoSuchMethodException e) {
              return type.getDeclaredMethod(name, types);
          }
      }
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.