QueryUtil { public static void setCountResult(Query query) { if (query == null) { throw new IllegalArgumentException(QUERY_CANNOT_BE_NULL); } query.setResult("count(this)"); } private  QueryUtil(); static void setQueryParams(Query query, QueryParams queryParams); static void useFilters(Query query, Filters filters); static void useFilter(Query query, String[] properties, Object[] values, Map<String, String> fieldTypeMap); static void useFilter(Query query, String[] properties, Object[] values, Map<String, String> fieldTypeMap,
                                 InstanceSecurityRestriction restriction); static void useFilter(Query query, List<Property> properties); static void useFilter(Query query, List<Property> properties,
                                 InstanceSecurityRestriction restriction); static void useFilterFromPattern(Query query, String pattern, List<Property> properties); static String asMatchesPattern(String string); static String asEqualsPattern(String string); static void setCountResult(Query query);  }
@Test public void shouldSetCountResult() { QueryUtil.setCountResult(query); verify(query).setResult("count(this)"); }
@Test(expected = IllegalArgumentException.class) public void shouldThrowIllegalArgumentExceptionForNullQueriesWhenSettingCountResult() { QueryUtil.setCountResult(null); }