@Override
    public Set<Resource> getResources(Request request, Predicate predicate)
        throws SystemException, UnsupportedPropertyException, NoSuchResourceException, NoSuchParentResourceException {

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

      for(Resource resource : allResources) {
        if (predicate.evaluate(resource)) {
          resources.add(new ResourceImpl(resource, request.getPropertyIds()));
        }
      }
      return resources;
    }
A test observer that records the last event.
ambari-server/src/test/java/org/apache/ambari/server/controller/internal/AbstractResourceProviderTest.java