Beispiel #1
0
 public boolean equals(Object obj) {
   if (!(obj instanceof Book)) return false;
   Book book = (Book) obj;
   return (this.ISBN == book.getISBN()
       && this.getTitle().equals(book.getTitle())
       && this.getAuthor().equals(book.getAuthor())
       && this.getPrice() == book.getPrice());
 }
Beispiel #2
0
 @Test
 public void testBookShouldHaveISBNNumber() throws Exception {
   Book book = new Book("TDD", 22341);
   assertEquals(22341, book.getISBN());
 }