### Question:
OrderBook implements Comparable { @Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } OrderBook orderBook = (OrderBook) o; return id == orderBook.id; } OrderBook(int id, String book, String type, String action, double price, int volume); @Override String toString(); @Override boolean equals(Object o); @Override int hashCode(); @Override int compareTo(Object o); int getId(); String getBook(); String getType(); String getAction(); double getPrice(); int getVolume();  }### Answer:
@Test public void ifIdEqualsThenOrdersShouldBeEquals() { OrderBook test1 = new OrderBook(1, "gazprom", "delete", "bid", 10, 100); OrderBook test2 = new OrderBook(1, "gazprom", "add", "bid", 10, 100); assertThat(test1.equals(test2), is(true)); }