public synchronized List<Book> getBooks() { return CollectionUtil.createList(books); }
Set<Book> current = CollectionUtil.createSet(new BookFilterIterator(books, BookFilters.getBooksByDriver(driver)));
@Override public synchronized List<Book> getBooks(BookFilter filter) { return CollectionUtil.createList(new BookFilterIterator(books, filter)); }
public List<Book> getBooks(BookFilter filter) { List<Book> temp = CollectionUtil.createList(new BookFilterIterator(getBooks(), filter)); return Collections.unmodifiableList(temp); }
@Override public List<Book> getBooks(BookFilter filter) { List<Book> books = null; synchronized (this) { books = getBooks(); } List<Book> temp = CollectionUtil.createList(new BookFilterIterator(books, filter)); return new BookSet(temp); }