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