public static Set<String> getCategories(Set<String> propertyIds) {
    Set<String> categories = new HashSet<>();
    for (String property : propertyIds) {
      String category = PropertyHelper.getPropertyCategory(property);
      while (category != null) {
        categories.add(category);
        category = PropertyHelper.getPropertyCategory(category);
      }
    }
    return categories;
  }
Get the set of categories for the given property ids.

@param propertyIds  the property ids

@return the set of categories
ambari-server/src/main/java/org/apache/ambari/server/controller/utilities/PropertyHelper.java