diff --git a/molgenis-search-elasticsearch/src/main/java/org/molgenis/elasticsearch/request/QueryGeneratorHelper.java b/molgenis-search-elasticsearch/src/main/java/org/molgenis/elasticsearch/request/QueryGeneratorHelper.java
index <HASH>..<HASH> 100644
--- a/molgenis-search-elasticsearch/src/main/java/org/molgenis/elasticsearch/request/QueryGeneratorHelper.java
+++ b/molgenis-search-elasticsearch/src/main/java/org/molgenis/elasticsearch/request/QueryGeneratorHelper.java
@@ -29,7 +29,7 @@ public class QueryGeneratorHelper
 
 	public QueryGeneratorHelper(List<QueryRule> rules, EntityMetaData metaData)
 	{
-		if (rules.size() == 0) throw new RuntimeException("The queryRules cannot be empty : " + rules);
+		if (rules.isEmpty()) throw new RuntimeException("The queryRules cannot be empty : " + rules);
 		baseQueryCollection = new LinkedHashMap<BaseQueryBuilder, Operator>(rules.size());
 		queryRules = rules;
 		entityMetaData = metaData;
changed the check on the size of list