public class Book { String isbn; String authors; String title; public Book(String isbn, String authors, String title) { this.isbn = isbn; this.authors = authors; this.title = title; } @Override public boolean equals(Object o) { if (o instanceof Book) { Book b = (Book) o; return isbn.equals(b.isbn); } return false; } @Override public int hashCode() { return isbn.hashCode(); } }