public static boolean containsProperty(Set<String> propertyIds, String propertyId) {

    if (propertyIds.contains(propertyId)){
      return true;
    }

    String category = PropertyHelper.getPropertyCategory(propertyId);
    while (category != null) {
      if ( propertyIds.contains(category)) {
        return true;
      }
      category = PropertyHelper.getPropertyCategory(category);
    }
    return false;
  }
Check if the given property id or one of its parent category ids is contained
in the given set of property ids.

@param propertyIds  the set of property ids
@param propertyId   the property id

@return true if the given property id of one of its parent category ids is
        contained in the given set of property ids
ambari-server/src/main/java/org/apache/ambari/server/controller/utilities/PropertyHelper.java