code: void update(JSONObject pJSONObject, MBeanInfo pMBeanInfo, Stack<String> pPathStack) {
  
          boolean isPathEmpty = pPathStack == null || pPathStack.empty();
          String filter = pPathStack != null && !pPathStack.empty() ? pPathStack.pop() : null;
          verifyThatPathIsEmpty(pPathStack);
  
          JSONObject attrMap = extractData(pMBeanInfo,filter);
  
          if (attrMap.size() > 0) {
              pJSONObject.put(getKey(), attrMap);
          } else if (!isPathEmpty) {
              throw new IllegalArgumentException("Path given but extracted value is empty");
          }
      }
docs: Update the given JSON object with the data extracted from the given
  MBeanInfo
  
  @param pJSONObject JSON object to update
  @param pMBeanInfo info to extract from
  @param pPathStack stack for further constraining the result