### Question:
HibernateFolderHistoryDAO extends HibernatePersistentObjectDAO<FolderHistory> implements FolderHistoryDAO { @Override public List<FolderHistory> findByUserId(long userId) { return findByUserIdAndEvent(userId, null); } 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 testDelete() throws PersistenceException { Collection<FolderHistory> histories = (Collection<FolderHistory>) dao.findByUserId(1); Assert.assertNotNull(histories); Assert.assertEquals(2, histories.size()); for (FolderHistory history : histories) { boolean result = dao.delete(history.getId()); Assert.assertTrue(result); } histories = (Collection<FolderHistory>) dao.findByUserId(4); Assert.assertNotNull(histories); Assert.assertEquals(0, histories.size()); }
@SuppressWarnings("rawtypes") @Test public void testFindByUserId() { Collection histories = dao.findByUserId(1); Assert.assertNotNull(histories); Assert.assertEquals(2, histories.size()); histories = dao.findByUserId(99); Assert.assertNotNull(histories); Assert.assertEquals(0, histories.size()); }