docs: private static Class<Object> guessMBeanInterface(Object instance) {
      Class<Object> mbeanInterface = null;
      Class<Object>[] interfaces = (Class<Object>[])instance.getClass().getInterfaces();
      for (Class<Object> anInterface : interfaces) {
        if (anInterface.getName().endsWith("MBean")) {
          mbeanInterface = anInterface;
          break;
        }
      }
      if (mbeanInterface == null) {
        throw new IllegalArgumentException("Can not find the MBean interface of class " + instance.getClass().getName());
      }
      return mbeanInterface;
    }