class CategoryIsEmptyPredicate extends CategoryPredicate {

  @Override
  public boolean evaluate(Resource resource) {
    String propertyId = getPropertyId();

    // If the property exists as a Map then check isEmpty
    Object value = resource.getPropertyValue(propertyId);
    if (value instanceof Map) {
      Map<?,?> mapValue = (Map) value;
      return mapValue.isEmpty();
    }
    // Get the category
    Map<String, Object> properties = resource.getPropertiesMap().get(propertyId);
    return properties == null ? true : properties.isEmpty();
  }

  public  CategoryIsEmptyPredicate(String propertyId);

}