### Question:
HibernateDashletDAO extends HibernatePersistentObjectDAO<Dashlet> implements DashletDAO { @Override public Dashlet findByName(String name, long tenantId) { List<Dashlet> dashlets = new ArrayList<Dashlet>(); try { dashlets = findByWhere("_entity.tenantId = ?1 and _entity.name = ?2", new Object[] { tenantId, name }, null, null); } catch (PersistenceException e) { log.error(e.getMessage(), e); } return dashlets != null && dashlets.size() > 0 ? dashlets.get(0) : null; } protected  HibernateDashletDAO(); @Override Dashlet findByName(String name, long tenantId); @Override boolean delete(long id, int code);  }### Answer:
@Test public void testFindByName() { Dashlet dashlet = dao.findByName("checkout", 1L); Assert.assertNotNull(dashlet); Assert.assertEquals(1L, dashlet.getId()); dashlet = dao.findByName("xxxx", 1L); Assert.assertNull(dashlet); }