static DBRecord createBinaryKeyRecord(Table table, int maxKeyLength, int varDataSize,
			boolean doInsert) throws IOException, DuplicateKeyException {
		int keyLength =
			(maxKeyLength < 0) ? -maxKeyLength : DBTestUtils.getRandomKeyLength(maxKeyLength);
		byte[] bytes = new byte[keyLength];
		random.nextBytes(bytes);
		Field key = varKeyType.newField();
		key.setBinaryData(bytes);

		try {
			DBRecord rec = createRecord(table, key, varDataSize, doInsert);
			Assert.assertEquals(key, rec.getKeyField());
			return rec;
		}
		catch (DuplicateKeyException dke) {
			return createBinaryKeyRecord(table, maxKeyLength, varDataSize, doInsert);
		}
	}
Create a new random-BinaryField-keyed record.
@param table
@param maxKeyLength maximum key length; if < 0 keyLength = -maxKeyLength
@param varDataSize
@param doInsert
@return Record
@throws IOException
@throws DuplicateKeyException
Ghidra/Framework/DB/src/test/java/db/DBTestUtils.java