### Question:
OntologyEntryEJB3DAO extends AnnotatableEJB3DAO<T> implements OntologyEntryDAO<T> { public T getByNameAndRefSource(String name, String refSourceAcc) { return (T) getSession().createCriteria(getPersistentClass()) .add(Restrictions.eq("name", name)) .createCriteria("source") .add(Restrictions.eq("acc", refSourceAcc)) .uniqueResult(); } OntologyEntryEJB3DAO(); protected  OntologyEntryEJB3DAO(Class<T> persistentClass);  OntologyEntryEJB3DAO(Class<T> persistentClass, EntityManager entityManager); T getByAcc(String acc); T getOntologyEntryByAcc(String acc); T getOntologyEntryByAccAndRefSource( String acc, String refSourceAcc); T getByNameAndRefSource(String name, String refSourceAcc); List<T> getOntologyEntriesByRefSource(String refSourceName); List<String> getOntologyEntryAccsByRefSource(String refSourceAcc);  }### Answer:
@Test public void testGetByNameAndRefSource() throws Exception { OntologyEntryEJB3DAO<Measurement> dao = (OntologyEntryEJB3DAO<Measurement>) daoFactory.getOntologyEntryDAO(Measurement.class); OntologyEntry ontologyEntryByAcc = dao.getByNameAndRefSource("Gene Expression", "BII-1"); assertNotNull(ontologyEntryByAcc); }