### Question:
Buffer extends BaseCustomIdType implements Comparable<Buffer> { @Override public int compareTo(Buffer o) { return Long.compare(getId(), o.getId()); } Buffer(long id); @Override boolean equals(Object o); @Override int hashCode(); @Override int compareTo(Buffer o);  }### Answer:
@Test public void compareToTest() { var bufferOne = new Buffer(1); var bufferTwo = new Buffer(2); assertTrue(bufferOne.compareTo(bufferTwo) < 0); assertTrue(bufferTwo.compareTo(bufferOne) > 0); var bufferOneAgain = new Buffer(1); assertEquals(0, bufferOne.compareTo(bufferOneAgain)); assertEquals(0, bufferOneAgain.compareTo(bufferOne)); }