The bookshelf

A bookshelf is a list of valid books. A book is valid when all Attributes are set and if the ISBN is valid.

If a invalid book is about to be saved, null is returned. Otherwise the result is an internal bookid. It is not allowed to save books with an identical ISBN

BookFixture
author title isbn price valid? save?
Vincent Massol, Ted Husted JUnit in Action 1930110995 26.37 true ${books.put(junit)}${nonEmpty()}
Vincent Massol, Ted Husted JUnit in Action 1930110996 26.37 false ${empty()}
Steve Loughran, Erik Hatcher Ant in Action 193239480X 31.49 true ${books.put(ant)}${nonEmpty()}
Steve Loughran, Erik Hatcher Ant in Action 193239480X 31.49 true ${empty()}

The ID identifies a book in the shelf

BookFixture
lookup lookup() isbn? title? price?
${books.get(ant)} 193239480X Ant in Action
${books.get(junit)} 1930110995 JUnit in Action