@Override public List<BookEntity> findBooksByAuthor(String author) { List<BookEntity> matchingList = new ArrayList<BookEntity>(); for (BookEntity bookEntity : ALL_BOOKS) { if (bookEntity.matchingAuthors(author)) { matchingList.add(bookEntity); } } return matchingList; }
@Override public List<BookEntity> findBookByTitle(String title) { List<BookEntity> matchingList = new ArrayList<BookEntity>(); for (BookEntity bookEntity : ALL_BOOKS) { if (bookEntity.getTitle().toLowerCase().startsWith(title.toLowerCase())) { matchingList.add(bookEntity); } } return matchingList; }