protected Set<Resource> getResources(Resource.Type type, Predicate predicate, String keyPropertyId, Set<String> keyPropertyValues)
        throws SystemException, UnsupportedPropertyException, NoSuchParentResourceException, NoSuchResourceException {
      Set<Resource> resources = new HashSet<>();

      for (Map<String, Object> propertyMap : getPropertyMaps(predicate)) {

        Set<Resource> resources2 = new HashSet<>();

        if (!propertyMap.containsKey(keyPropertyId)) {
          for (String keyPropertyValue : keyPropertyValues) {
            ResourceImpl resource = new ResourceImpl(type);
            resource.setProperty(keyPropertyId, keyPropertyValue);
            resources2.add(resource);
          }
        } else {
          resources2.add(new ResourceImpl(type));
        }

        for (Resource resource : resources2) {
          for (Map.Entry<String, Object> entry : propertyMap.entrySet()) {
            resource.setProperty(entry.getKey(), entry.getValue());
          }
        }
        resources.addAll(resources2);
      }
      return resources;
    }
Tests that when a {@link PageResponse} is present on the
{@link Request}, in-memory paging is not performed.

@throws Exception
ambari-server/src/test/java/org/apache/ambari/server/controller/internal/ClusterControllerImplTest.java