UID { @Override public boolean equals(final Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; final UID uid = (UID) o; return Objects.equals(byteBuffer, uid.byteBuffer); } private  UID(final ByteBuffer byteBuffer); static UID wrap(final ByteBuffer byteBuffer); static UID of(final ByteBuffer byteBuffer, final int... byteValues); static UID of(final long value, final ByteBuffer byteBuffer); static UID minimumValue(final ByteBuffer byteBuffer); static void writeMinimumValue(final ByteBuffer byteBuffer); UID cloneToNewBuffer(); UID cloneToBuffer(final ByteBuffer destByteBuffer); long getValue(); UID nextUid(final ByteBuffer byteBuffer); void writeNextUid(final ByteBuffer byteBuffer); ByteBuffer getBackingBuffer(); static int length(); @Override String toString(); @Override boolean equals(final Object o); @Override int hashCode(); static final UnsignedBytes UNSIGNED_BYTES; static final int UID_ARRAY_LENGTH; }
@Test void testEquals() { final UID uid1 = UID.of(getNewUidBuffer(), 0, 0, 0, 5); final ByteBuffer byteBuffer = getNewUidBuffer(); UID uid2 = UID.of(5, byteBuffer); LOGGER.info("uid1: {}", uid1); LOGGER.info("uid2: {}", uid2); Assertions.assertThat(uid2.getBackingBuffer()) .isEqualByComparingTo(uid1.getBackingBuffer()); Assertions.assertThat(uid2) .isEqualTo(uid1); }