code: @FFDCIgnore(Throwable.class)
      String getFormattedAttribute(MBeanServer mbeanServer, ObjectName mbean, MBeanAttributeInfo attr, String indent) {
          try {
              Object attribute = mbeanServer.getAttribute(mbean, attr.getName());
              if (attribute == null) {
                  return "null";
              } else if (CompositeData.class.isAssignableFrom(attribute.getClass())) {
                  return getFormattedCompositeData(CompositeData.class.cast(attribute), indent);
              } else if (TabularData.class.isAssignableFrom(attribute.getClass())) {
                  return getFormattedTabularData(TabularData.class.cast(attribute), indent);
              } else if (attribute.getClass().isArray()) {
                  return getFormattedArray(attribute, indent);
              } else {
                  return String.valueOf(attribute);
              }
          } catch (Throwable t) {
              Throwable rootCause = t;
              while (rootCause.getCause() != null) {
                  rootCause = rootCause.getCause();
              }
  
              StringBuilder sb = new StringBuilder();
              sb.append("<<Unavailable: ");
              sb.append(rootCause.getMessage() != null ? rootCause.getMessage() : rootCause);
              sb.append(">>");
              return sb.toString();
          }
      }
docs: Attempt for format an MBean attribute. Composite and Tabular data types will
  be recursively formatted, arrays will be formatted with each entry on one line,
  while all others will rely on the value returned by {@code toString}.
  
  @param mbeanServer the mbean server hosting the mbean
  @param mbean the mbean associated with the attribute
  @param attr the mbean attribute to format
  @param indent the current indent level of the formatted report
  
  @return the formatted attribute