### Question:
BusinessLogic { public List<String> getAllBooksNames() { List<String> result = new ArrayList<>(); dao.getAllBooks().forEach(b -> result.add(b.getName())); return result; }  void setDao(DAO dao); List<String> getAllBooksNames();  }### Answer:
@Test public void getAllBooksNamesTest() { BusinessLogic logic = new BusinessLogic(); logic.setDao(dao); List<String> booksNames = logic.getAllBooksNames(); assertEquals(new ArrayList() {{ add("Java For Junior"); add("Java For Middle"); add("Java For Senior"); }}, booksNames); }