@Test public void equalsTest() { var bufferOne = new Buffer(1); var bufferTwo = new Buffer(2); assertNotEquals(bufferOne, bufferTwo); assertEquals(bufferOne.equals(bufferTwo), bufferTwo.equals(bufferOne)); var bufferOneAgain = new Buffer(1); var bufferOneSame = bufferOne; assertEquals(bufferOne, bufferOneSame); assertEquals(bufferOne, bufferOneAgain); assertEquals(bufferOne.equals(bufferOneAgain), bufferOneAgain.equals(bufferOneSame)); }
@Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; var buffer = (Buffer) o; return getId() == buffer.getId(); }
Buffer extends BaseCustomIdType implements Comparable<Buffer> { @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; var buffer = (Buffer) o; return getId() == buffer.getId(); } }
Buffer extends BaseCustomIdType implements Comparable<Buffer> { @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; var buffer = (Buffer) o; return getId() == buffer.getId(); } Buffer(long id); }
Buffer extends BaseCustomIdType implements Comparable<Buffer> { @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; var buffer = (Buffer) o; return getId() == buffer.getId(); } Buffer(long id); @Override boolean equals(Object o); @Override int hashCode(); @Override int compareTo(Buffer o); }
Buffer extends BaseCustomIdType implements Comparable<Buffer> { @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; var buffer = (Buffer) o; return getId() == buffer.getId(); } Buffer(long id); @Override boolean equals(Object o); @Override int hashCode(); @Override int compareTo(Buffer o);  }