### Question:
WizardDaoImpl extends DaoBaseImpl<Wizard> implements WizardDao { @Override public Wizard findByName(String name) { Transaction tx = null; Wizard result; try (var session = getSessionFactory().openSession()) { tx = session.beginTransaction(); var criteria = session.createCriteria(persistentClass); criteria.add(Restrictions.eq("name", name)); result = (Wizard) criteria.uniqueResult(); tx.commit(); } catch (Exception e) { if (tx != null) { tx.rollback(); } throw e; } return result; }  @Override Wizard findByName(String name);  }### Answer:
@Test public void testFindByName() { final var dao = getDao(); final var allWizards = dao.findAll(); for (final var spell : allWizards) { final var byName = dao.findByName(spell.getName()); assertNotNull(byName); assertEquals(spell.getId(), byName.getId()); assertEquals(spell.getName(), byName.getName()); } }