### Question:
HibernateDocumentHistoryDAO extends HibernatePersistentObjectDAO<DocumentHistory> implements DocumentHistoryDAO { public List<DocumentHistory> findByFolderId(long folderId) { try { return findByWhere("_entity.folderId =" + folderId, "order by _entity.date asc", null); } catch (PersistenceException e) { log.error(e.getMessage(), e); return new ArrayList<DocumentHistory>(); } } private  HibernateDocumentHistoryDAO(); List<DocumentHistory> findByDocId(long docId); @Override List<DocumentHistory> findByDocIdAndEvent(long docId, String event); List<DocumentHistory> findByUserId(long userId); List<DocumentHistory> findByFolderId(long folderId); @Override List<DocumentHistory> findNotNotified(Integer max); @Override void cleanOldHistories(int ttl); @Override List<DocumentHistory> findByUserIdAndEvent(long userId, String event, String sessionId); @Override void markHistoriesAsRead(String event, long userId); @Override boolean store(DocumentHistory history); @Override List<DocumentHistory> findByPath(String pathExpression, Date olderDate, Collection<String> events,
			Integer max);  }### Answer:
@SuppressWarnings("rawtypes") @Test public void testFindByFolderId() { Collection histories = dao.findByFolderId(5); Assert.assertNotNull(histories); Assert.assertEquals(2, histories.size()); histories = dao.findByFolderId(99); Assert.assertNotNull(histories); Assert.assertEquals(0, histories.size()); }