private String getSubResourceName(ResourceDefinition resource, SubResourceDefinition subResource) {
    return subResource.isCollection() ?
        resource.getPluralName() :
        resource.getSingularName();
  }
Obtain the name of a sub-resource.

@param resource     parent resource
@param subResource  sub-resource

@return either the plural or singular sub-resource name based on whether the sub-resource is
        included as a collection
ambari-server/src/main/java/org/apache/ambari/server/api/query/QueryImpl.java