code: public Loan attemptLoan(String isbn, String loanId) {
          Loan loan = new Loan();
          loan.setId(loanId);
          Book book = getBook(isbn);
          if (book != null) {
              synchronized (librarian) {
                  int quantity = getQuantity(book);
                  if (quantity > 0) {
                      quantity--;
                      isbns_to_quantities.put(isbn, quantity);
                      loan.setApproved(true);
                      loan.setNotes("Happy reading! Remaining copies: " + quantity);
                      loan.setBook(book);
                  } else {
                      loan.setApproved(false);
                      loan.setNotes("Book has no copies available.");
                  }
              }
          } else {
              loan.setApproved(false);
              loan.setNotes("No book matching isbn: " + isbn);
          }
          return loan;
      }
docs: Attempt loan.
  
  @param isbn the isbn
  @param loanId the loan id
  @return the loan