private QueryExp buildQueryExp(final String pidAttribute, final String[] attributes,
      final Object[] values) {
    QueryExp optionalAttributes = buildOptionalQueryExp(attributes, values);
    QueryExp constraint;
    if (optionalAttributes != null) {
      constraint =
          Query.and(optionalAttributes, Query.eq(Query.attr(pidAttribute), Query.value(pid)));
    } else {
      constraint = Query.eq(Query.attr(pidAttribute), Query.value(pid));
    }
    return constraint;
  }
Builds the QueryExp used to identify the target MBean.

@param pidAttribute the name of the MBean attribute with the process id to compare against
@param attributes the names of additional MBean attributes to compare with expected values
@param values the expected values of the specified MBean attributes

@return the main QueryExp for matching the target MBean
geode-core/src/main/java/org/apache/geode/internal/process/MBeanProcessController.java