static DBRecord createRecord(Table table, long key, int varDataSize, boolean doInsert)
			throws IOException, DuplicateKeyException {
		// Check for duplicate key
		if (doInsert) {
			DBRecord oldRec = table.getRecord(key);
			if (oldRec != null) {
				throw new DuplicateKeyException();
			}
		}

		// Create record and fill with data
		DBRecord rec = table.getSchema().createRecord(key);
		fillRecord(rec, varDataSize);

		// Insert record if requested
		if (doInsert) {
			int cnt = table.getRecordCount();
			table.putRecord(rec);
			Assert.assertEquals(1, table.getRecordCount() - cnt);
		}

		return rec;
	}
Create a new record.
@param table table
@param key record key
 @param varDataSize number of bytes created for all variable length fields
@param doInsert insert record into table if true
@return Record new record
@throws IOException
@throws DuplicateKeyException record with assigned key already exists in table.
Ghidra/Framework/DB/src/test/java/db/DBTestUtils.java