### Question:
HibernateFolderHistoryDAO extends HibernatePersistentObjectDAO<FolderHistory> implements FolderHistoryDAO { @Override public boolean store(FolderHistory entity) throws PersistenceException { if (RunLevel.current().aspectEnabled(FolderHistory.ASPECT)) { boolean ret = super.store(entity); if (ret) EventCollector.get().newEvent(entity); return ret; } else return true; } private  HibernateFolderHistoryDAO(); @Override List<FolderHistory> findByUserId(long userId); @Override List<FolderHistory> findByFolderId(long folderId); @Override List<FolderHistory> findNotNotified(Integer max); @Override void cleanOldHistories(int ttl); @Override List<FolderHistory> findByUserIdAndEvent(long userId, String event); @Override boolean store(FolderHistory entity); @Override List<FolderHistory> findByPath(String pathExpression, Date olderDate, Collection<String> events,
			Integer max); @Override List<FolderHistory> findByFolderIdAndEvent(long folderId, String event, Date oldestDate);  }### Answer:
@Test public void testStore() throws PersistenceException { FolderHistory history = new FolderHistory(); history.setDocId(1L); history.setFolderId(5L); history.setDate(DateBean.dateFromCompactString("20061220")); history.setUsername("sebastian"); history.setUserId(3L); history.setEvent("test FolderHistory store"); Assert.assertTrue(dao.store(history)); FolderHistory folderFolderHistory = new FolderHistory(); folderFolderHistory.setFolderId(5L); folderFolderHistory.setDate(DateBean.dateFromCompactString("20061220")); folderFolderHistory.setUsername("sebastian"); folderFolderHistory.setUserId(3L); folderFolderHistory.setEvent("test FolderHistory store"); Assert.assertTrue(dao.store(folderFolderHistory)); Collection<FolderHistory> histories = (Collection<FolderHistory>) dao.findByUserId(3); Assert.assertNotNull(histories); Assert.assertFalse(histories.isEmpty()); FolderHistory hStored = null; for (FolderHistory history2 : histories) { if (history2.getId() == folderFolderHistory.getId()) { hStored = history2; break; } } Assert.assertTrue(hStored.equals(folderFolderHistory)); Assert.assertEquals(hStored.getFolderId(), new Long(5)); Assert.assertEquals(hStored.getDate().getTime(), DateBean.dateFromCompactString("20061220").getTime()); Assert.assertEquals(hStored.getUsername(), "sebastian"); Assert.assertEquals(hStored.getEvent(), "test FolderHistory store"); }