WordTemplateQuery implements TemplateQuery { List<PersistentTemplate> list(EntityManager entityManager) { query.where(restrictions.toArray(new Predicate[restrictions.size()])); TypedQuery<PersistentTemplate> executableQuery = entityManager .createQuery(query); return executableQuery.getResultList(); } WordTemplateQuery(WordTemplateRepository aRepository,
			CriteriaBuilder aCriteriaBuilder); WordTemplateQuery documentName(String name); WordTemplateQuery language(String language); WordTemplateQuery inputType(Class<?> clazz); WordTemplateQuery hasProperties(Map<String, String> someProperties); WordTemplateQuery editor(String userId); WordTemplateQuery isLocked(boolean locked); WordTemplateQuery isLockedBy(String userId); @Override List<Template<Object>> list();  }
@Test public void queryAll() { List<PersistentTemplate> result = query().list(entityManager); assertEquals(4, result.size()); }