private Library buildMockLibraryWithSetBookAmounts(
     int numberOfBooksAvailable, int numberOfBooksCheckedOut) {
   library = mock(Library.class);
   when(library.numberOfBooksInLibrary()).thenReturn(numberOfBooksAvailable);
   when(library.numberOfBooksCheckedOut()).thenReturn(numberOfBooksCheckedOut);
   for (int i = 0; i < numberOfBooksAvailable; i++) {
     when(library.bookIsAvailable(i)).thenReturn(true);
   }
   for (int i = 0; i < numberOfBooksCheckedOut; i++) {
     when(library.bookIsCheckedOut(i)).thenReturn(true);
   }
   return library;
 }