### Question:
PricingTemplateDAO extends DefaultDAOBase<Integer, PricingTemplate> { public List<PricingTemplate> findPricingTemplatesByCurrency(final Integer idCurrency) { Criteria crit = createNestedCriteria(PricingTemplate.CURRENCY_PROPERTY); crit.add(Restrictions.eq(PersistentEntity.ID_PROPERTY, idCurrency)); return getResultList(crit); } 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 findAllPricingTemplatesByCurrency() { PricingTemplate pt1 = eg().createInstance("pt1"); PricingTemplate pt2 = eg().createInstance("pt2"); ds().persistAll(pt1.getCurrency(), pt2.getCurrency(), pt1, pt2); PricingTemplateDAO dao = createDaoForRollbackTransaction(); Collection<PricingTemplate> pts = dao.findPricingTemplatesByCurrency(pt1.getCurrency().getId()); AssertEx.assertSize(pts, 1); pts = dao.findPricingTemplatesByCurrency(pt2.getCurrency().getId()); AssertEx.assertSize(pts, 1); }