WordTemplateRepository implements TemplateRepository { @Override public TemplateQuery queryTemplates() { return new WordTemplateQuery(this, em.getCriteriaBuilder()); } WordTemplateRepository();  WordTemplateRepository(EntityManager em, TemplateContextFactory contextFactory); void setFileStore(FileStore fileStore); @Override TemplateQuery queryTemplates(); @Override Template<Object> getTemplate(String documentName, String language); @Override Template<E> getTemplate(String documentName, String language,
			Class<? extends E> inputType); @Override Template<E> lockForEdit(Template<E> aTemplate, User user); @Override Template<E> unlock(Template<E> template); @Override Template<E> persist(Template<E> toPersist); @Override void delete(Template<?> template); @Transactional List<Template<Object>> execute(WordTemplateQuery query);  }
@Test @Transactional public void testQueryTemplates() { TemplateQuery query = repository.queryTemplates(); List<Template<Object>> templates = query.list(); assertEquals(4, templates.size()); }
@Test @Transactional public void testQueryWithEmptyResults() { TemplateQuery query = repository.queryTemplates(); List<Template<Object>> templates = query.language("xxx").list(); assertEquals(0, templates.size()); }