@Test
public void testApply() {

  Resource resource = new ResourceImpl(Resource.Type.HostComponent);
  String categoryId = PropertyHelper.getPropertyId("category1", null);
  Predicate predicate = new CategoryIsEmptyPredicate(categoryId);
  Assert.assertTrue(predicate.evaluate(resource));
  resource.addCategory(categoryId);
  Assert.assertTrue(predicate.evaluate(resource));
  String propertyId = PropertyHelper.getPropertyId("category1", "bar");
  resource.setProperty(propertyId, "value1");
  Assert.assertFalse(predicate.evaluate(resource));
}