bool matches(Entity entity) { if (any.isEmpty && all.isEmpty) { return true; } final anyMatched = matchesAny(entity); final allMatched = matchesAll(entity); return anyMatched && allMatched; }