### Question:
PricingTemplateDAO extends DefaultDAOBase<Integer, PricingTemplate> { public Collection<PricingTemplate> find(final String filter, final String orderBy, final boolean desc, final Integer offset, Integer numResults, final Integer startwith) { Criteria criteria = createCriteria(filter, orderBy, desc); Long total = count(criteria); criteria = createCriteria(filter, orderBy, desc); numResults = (int) (numResults != 0 ? numResults : total); criteria.setFirstResult(offset * numResults); if (startwith != -1) { criteria.setFirstResult(startwith); } criteria.setMaxResults(numResults); List<PricingTemplate> result = getResultList(criteria); PagedList<PricingTemplate> page = new PagedList<PricingTemplate>(); page.addAll(result); page.setCurrentElement(offset); if (startwith != -1) { page.setCurrentElement(startwith); } page.setPageSize(numResults); page.setTotalResults(total.intValue()); return page; } PricingTemplateDAO();  PricingTemplateDAO(final EntityManager entityManager); static Criterion sameName(final String name); boolean existAnyOtherPricingTempWithName(final PricingTemplate pt, final String name); boolean existAnyPricTempWithSameName(final String name); Collection<PricingTemplate> find(final String filter, final String orderBy,
        final boolean desc, final Integer offset, Integer numResults, final Integer startwith); List<PricingTemplate> findAllPricingTemplateByName(final String name); List<PricingTemplate> findPricingTemplatesByCurrency(final Integer idCurrency);  }### Answer:
@Test public void findPricingTemplates() { PricingTemplate pt1 = eg().createUniqueInstance(); PricingTemplate pt2 = eg().createUniqueInstance(); ds().persistAll(pt1.getCurrency(), pt2.getCurrency(), pt1, pt2); PricingTemplateDAO dao = createDaoForRollbackTransaction(); Collection<PricingTemplate> pts = dao.find(null, null, false, 0, 25, -1); AssertEx.assertSize(pts, 2); }