### Question:
HibernateDocumentLinkDAO extends HibernatePersistentObjectDAO<DocumentLink> implements DocumentLinkDAO { @Override public List<DocumentLink> findByDocId(long docId) { return findByDocId(docId, null); } HibernateDocumentLinkDAO(); @Override List<DocumentLink> findByDocId(long docId); @Override List<DocumentLink> findByDocId(long docId, String type); @Override DocumentLink findByDocIdsAndType(long docId1, long docId2, String type); @Override boolean delete(long id, int code); @Override boolean store(DocumentLink entity);  }### Answer:
@Test public void testFindByDocId() { Collection<DocumentLink> links = dao.findByDocId(1, null); Assert.assertNotNull(links); Assert.assertEquals(4, links.size()); Collection<DocumentLink> links2 = dao.findByDocId(2, null); Assert.assertNotNull(links2); Assert.assertEquals(4, links.size()); Collection<DocumentLink> links3 = dao.findByDocId(99, null); Assert.assertNotNull(links3); Assert.assertEquals(0, links3.size()); links = dao.findByDocId(1, "test"); Assert.assertNotNull(links); Assert.assertEquals(1, links.size()); links2 = dao.findByDocId(99, "pippo"); Assert.assertNotNull(links2); Assert.assertEquals(0, links2.size()); links2 = dao.findByDocId(1, "pippo"); Assert.assertNotNull(links2); Assert.assertEquals(0, links2.size()); }