docs: static Long callLongGetter(Method method, Object obj) throws InvocationTargetException  {
      try {
        return (Long) method.invoke(obj);
      } catch (IllegalAccessException e) {
        // Expected, the declaring class or interface might not be public.
      }
  
      // Iterate over all implemented/extended interfaces and attempt invoking the method with the
      // same name and parameters on each.
      for (Class<?> clazz : method.getDeclaringClass().getInterfaces()) {
        try {
          Method interfaceMethod = clazz.getMethod(method.getName(), method.getParameterTypes());
          Long result = callLongGetter(interfaceMethod, obj);
          if (result != null) {
            return result;
          }
        } catch (NoSuchMethodException e) {
          // Expected, class might implement multiple, unrelated interfaces.
        }
      }
  
      return null;
    }