private BlobId getRandomBlobId(short version) {
    byte[] bytes = new byte[2];
    random.nextBytes(bytes);
    random.nextBytes(bytes);
    byte datacenterId = bytes[0];
    short accountId = getRandomShort(random);
    short containerId = getRandomShort(random);
    BlobIdType type = random.nextBoolean() ? BlobIdType.NATIVE : BlobIdType.CRAFTED;
    PartitionId partitionId =
        referenceClusterMap.getWritablePartitionIds(MockClusterMap.DEFAULT_PARTITION_CLASS).get(random.nextInt(3));
    boolean isEncrypted = random.nextBoolean();
    BlobDataType dataType = BlobDataType.values()[random.nextInt(BlobDataType.values().length)];
    return new BlobId(version, type, datacenterId, accountId, containerId, partitionId, isEncrypted, dataType);
  }
Constructs a {@link BlobId} with random fields and the given version.
@param version The version of {@link BlobId} to build
@return A {@link BlobId} with random fields and the given version.
ambry-commons/src/test/java/com/github/ambry/commons/BlobIdTest.java