static void fillRecord(DBRecord rec, int varDataSize) {

		Field[] fields = rec.getFields();
		for (int i = 0; i < fields.length; i++) {
			if (fields[i] instanceof BooleanField) {
				rec.setBooleanValue(i, (random.nextInt() % 2) == 0);
			}
			else if (fields[i] instanceof ByteField) {
				rec.setByteValue(i, (byte) random.nextInt());
			}
			else if (fields[i] instanceof ShortField) {
				rec.setShortValue(i, (short) random.nextInt());
			}
			else if (fields[i] instanceof IntField) {
				rec.setIntValue(i, random.nextInt());
			}
			else if (fields[i] instanceof LongField) {
				rec.setLongValue(i, random.nextLong());
			}
			else if (fields[i] instanceof StringField) {
				int size = varDataSize;
				if (size < 0) {
					size = random.nextInt(6) - 1;
				}
				if (size < 0) {
					rec.setString(i, null);
				}
				else {
					char[] chars = new char[size];
					for (int n = 0; n < chars.length; n++) {
						chars[n] = (char) (random.nextInt() & 0x7fff);
					}
					String str = new String(chars);
					rec.setString(i, str);
				}
			}
			else if (fields[i] instanceof BinaryField) {
				int size = fields[i].isVariableLength() ? varDataSize : fields[i].length();
				if (size < 0) {
					size = random.nextInt(6) - 1;
				}
				if (size < 0) {
					rec.setBinaryData(i, null);
				}
				else {
					byte[] bytes = new byte[size];
					random.nextBytes(bytes);
					rec.setBinaryData(i, bytes);
				}
			}
			else {
				Assert.fail();
			}
		}

	}
Fill record with random data.
@param rec record
@param varDataSize number of bytes to fill into all variable length fields.
NOTE: The StringField does not strictly follow the varDataSize paramter.
A value less than 0 results in a null assignment to those fields.
Ghidra/Framework/DB/src/test/java/db/DBTestUtils.java