public static void copyWithNewUid(final ByteBuffer sourceByteBuffer,
                                      final ByteBuffer destByteBuffer,
                                      final UID newUid) {
        Objects.requireNonNull(sourceByteBuffer);
        Objects.requireNonNull(destByteBuffer);
        Objects.requireNonNull(newUid);

        if (destByteBuffer.remaining() < sourceByteBuffer.remaining()) {
            throw new RuntimeException(LogUtil.message("Insufficient remaining, source: {}, dest: {}",
                    sourceByteBuffer.remaining(),
                    destByteBuffer.remaining()));
        }

        destByteBuffer.put(newUid.getBackingBuffer());
        final ByteBuffer rangePartBuffer = sourceByteBuffer.slice(
                RANGE_FROM_OFFSET,
                Long.BYTES * 2);
        destByteBuffer.put(rangePartBuffer);
        destByteBuffer.flip();
        sourceByteBuffer.rewind();
    }
Copy the contents of sourceByteBuffer into destByteBuffer but with the supplied UID.
stroom-pipeline/src/main/java/stroom/pipeline/refdata/store/offheapstore/serdes/RangeStoreKeySerde.java