@Test public void compareToTest() { assertEquals(0, b.compareTo(b)); assertEquals(-1, b.compareTo(c)); assertEquals(1, c.compareTo(b)); }
@Override public int compareTo(final Book that) { return ComparisonChain.start() .compare(this.isbn, that.isbn) .result(); }
Book implements Serializable, Comparable<Book> { @Override public int compareTo(final Book that) { return ComparisonChain.start() .compare(this.isbn, that.isbn) .result(); } }
Book implements Serializable, Comparable<Book> { @Override public int compareTo(final Book that) { return ComparisonChain.start() .compare(this.isbn, that.isbn) .result(); }  }
Book implements Serializable, Comparable<Book> { @Override public int compareTo(final Book that) { return ComparisonChain.start() .compare(this.isbn, that.isbn) .result(); }  @XmlTransient String get_id(); void set_id(final String _id); @XmlElement(name = "isbn") String getIsbn(); void setIsbn(@Nonnull final String isbn); @Nullable @XmlElement(name = "author") String getAuthor(); void setAuthor(@Nullable final String author); @Nullable @XmlElement(name = "title") String getTitle(); void setTitle(@Nullable final String title); @Nullable @XmlElement(name = "price") BigDecimal getPrice(); void setPrice(@Nullable final BigDecimal price); @Nonnull @XmlElement(name = "category") Set<String> getCategories(); void setCategories(@Nonnull final Set<String> categories); @Override boolean equals(final Object o); @Override int hashCode(); @Override String toString(); @Override int compareTo(final Book that); }
Book implements Serializable, Comparable<Book> { @Override public int compareTo(final Book that) { return ComparisonChain.start() .compare(this.isbn, that.isbn) .result(); }  @XmlTransient String get_id(); void set_id(final String _id); @XmlElement(name = "isbn") String getIsbn(); void setIsbn(@Nonnull final String isbn); @Nullable @XmlElement(name = "author") String getAuthor(); void setAuthor(@Nullable final String author); @Nullable @XmlElement(name = "title") String getTitle(); void setTitle(@Nullable final String title); @Nullable @XmlElement(name = "price") BigDecimal getPrice(); void setPrice(@Nullable final BigDecimal price); @Nonnull @XmlElement(name = "category") Set<String> getCategories(); void setCategories(@Nonnull final Set<String> categories); @Override boolean equals(final Object o); @Override int hashCode(); @Override String toString(); @Override int compareTo(final Book that);  }