@Override
  public List<Wizard> findWizardsWithSpellbook(String name) {
    var spellbook = spellbookDao.findByName(name);
    return new ArrayList<>(spellbook.getWizards());
  }
@Test
  void testFindWizardsWithSpellbook() {
    final var bookname = "bookname";
    final var spellbook = mock(Spellbook.class);
    final var wizards = Set.of(
        mock(Wizard.class),
        mock(Wizard.class),
        mock(Wizard.class)
    );
    when(spellbook.getWizards()).thenReturn(wizards);

    final var spellbookDao = mock(SpellbookDao.class);
    when(spellbookDao.findByName(bookname)).thenReturn(spellbook);

    final var wizardDao = mock(WizardDao.class);
    final var spellDao = mock(SpellDao.class);


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

    final var result = service.findWizardsWithSpellbook(bookname);
    verify(spellbookDao).findByName(bookname);
    verify(spellbook).getWizards();

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

    verifyNoMoreInteractions(wizardDao, spellbookDao, spellDao);
  }