@Override
  public List<Wizard> findWizardsWithSpell(String name) {
    var spell = spellDao.findByName(name);
    var spellbook = spell.getSpellbook();
    return new ArrayList<>(spellbook.getWizards());
  }
@Test
  void testFindWizardsWithSpell() {
    final var wizards = Set.of(
        mock(Wizard.class),
        mock(Wizard.class),
        mock(Wizard.class)
    );
    final var spellbook = mock(Spellbook.class);
    when(spellbook.getWizards()).thenReturn(wizards);

    final var spellbookDao = mock(SpellbookDao.class);
    final var wizardDao = mock(WizardDao.class);

    final var spell = mock(Spell.class);
    when(spell.getSpellbook()).thenReturn(spellbook);

    final var spellName = "spellname";
    final var spellDao = mock(SpellDao.class);
    when(spellDao.findByName(spellName)).thenReturn(spell);

    final var service = new MagicServiceImpl(wizardDao, spellbookDao, spellDao);
    verifyNoInteractions(wizardDao, spellbookDao, spellDao, spellbook);

    final var result = service.findWizardsWithSpell(spellName);
    verify(spellDao).findByName(spellName);
    verify(spellbook).getWizards();

    assertNotNull(result);
    assertEquals(3, result.size());

    verifyNoMoreInteractions(wizardDao, spellbookDao, spellDao);
  }