Another possible mismatch is when you try to check out a book that is
already checked out, or return a book that is already marked available.
Yes, when you get a COLLISION, you still have an element inserted.
For the books, consider the ID as an unique identifier. You don't need
to check the name of the book. When you want to insert, whether the
book name is equal or not, if the id of the new item is already in the
list. It should not be inserted.
For trying to check out a book that is already checked out. Or return
a book that is already returned. We won't test this. However, just in
case your program didn't execute some command (Just assuming a bug in
your program), then if you try to check out a book already checked
out, it remains checked out. The same for available books, if they are
returned, they remain returned.
Let me know if there are further questions, We talked about all of
this on the class Tuesday. Sorry if it wasn't clear.
Regards,
Mario