UID { public UID nextUid(final ByteBuffer byteBuffer) { writeNextUid(byteBuffer); return UID.wrap(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 nextUid() { final UID uid1 = UID.of(getNewUidBuffer(), 0, 0, 0, 1); LOGGER.info("uid1 {}", ByteBufferUtils.byteBufferInfo(uid1.getBackingBuffer())); final UID uid2 = uid1.nextUid(getNewUidBuffer()); Assertions.assertThat(uid2.getBackingBuffer()) .isEqualByComparingTo(UID.of(getNewUidBuffer(), 0,0,0,2).getBackingBuffer()); }