### Question:
BusinessLogic { public Book getFullBook(Book book) { if (book.getId() != null) { Book bookById = dao.getBookById(book.getId()); return bookById; } else if (book.getName() != null) { return dao.getBookByName(book.getName()); } else { return null; } }  void setDao(DAO dao); Book getFullBook(Book book);  }### Answer:
@Test public void getFullBookTest() { BusinessLogic logic = new BusinessLogic(); logic.setDao(dao); Book actualBook1 = logic.getFullBook(new Book(1L, null, null)); verify(dao).getBookById(1L); assertEquals(book1, actualBook1); Book actualBook2 = logic.getFullBook(new Book(null, "Java For Middle", null)); verify(dao).getBookByName("Java For Middle"); assertEquals(book2, actualBook2); }