### Question:
HibernateVersionDAO extends HibernatePersistentObjectDAO<Version> implements VersionDAO { @Override public Version findByFileVersion(long docId, String fileVersion) { List<Version> versions = new ArrayList<Version>(); try { versions = findByWhere(" _entity.docId=" + docId + " and _entity.fileVersion='" + fileVersion + "'", "order by _entity.date asc", null); } catch (PersistenceException e) { log.error(e.getMessage(), e); } if (!versions.isEmpty()) return versions.get(0); else return null; } private  HibernateVersionDAO(); @Override List<Version> findByDocId(long docId); @Override Version findByVersion(long docId, String version); @Override Version findByFileVersion(long docId, String fileVersion); @Override void initialize(Version version); @Override boolean store(Version version); @Override void updateDigest(Version version); void setStorer(Storer storer); @Override boolean delete(long versionId, int delCode); void setFolderDAO(FolderDAO folderDAO);  }### Answer:
@Test public void testFindByFileVersion() { Version version = dao.findByFileVersion(1, "fileVer02"); Assert.assertNotNull(version); Assert.assertEquals("fileVer02", version.getFileVersion()); version = dao.findByVersion(1, "30"); Assert.assertNull(version); }