public Collection < Book > getAvailableBooks ( ) { synchronized ( librarian ) { Collection < Book > books = new LinkedList < Book > ( ) ; for ( Entry < String , Integer > entry : isbns_to_quantities . entrySet ( ) ) { if ( entry . getValue ( ) > 0 ) { books . add ( getBook ( entry . getKey ( ) ) ) ; } } return books ; } }
Gets the available books .