code: private static Method getMethod(Object source, String methodName, String name) {
          try {
              Method method = source.getClass().getMethod(methodName);
              method.setAccessible(true);
              return method;
          } catch (Exception e) {
              if (LOGGER.isFinestEnabled()) {
                  LOGGER.log(Level.FINEST,
                          "Unable to register OperatingSystemMXBean method " + methodName + " used for probe " + name, e);
              }
              return null;
          }
      }
docs: Returns a method from the given source object.
  
  @param source     the source object.
  @param methodName the name of the method to retrieve.
  @param name the probe name
  @return the method