static BinaryField decrement(BinaryField field, int maxLength) {

		byte[] bytes = field.getBinaryData();
		if (bytes == null) {
			Assert.fail("Bad test data: attempt to deccrement min value ");
		}

		int len = bytes.length;
		if (len == 0) {
			return new BinaryField(null);
		}
		byte[] newBytes;
		if (bytes[len - 1] == 0) {
			// chop trailing 00 byte
			newBytes = new byte[len - 1];
			System.arraycopy(bytes, 0, newBytes, 0, len - 1);
		}
		else if (len < maxLength) {
			// Simply create maximum length value with trailing ff's
			newBytes = new byte[maxLength];
			System.arraycopy(bytes, 0, newBytes, 0, len);
			--newBytes[len - 1];
			for (int i = len; i < maxLength; i++) {
				newBytes[i] = (byte) 0xff;
			}
		}
		else {
			// decrement last byte only
			newBytes = new byte[len];
			System.arraycopy(bytes, 0, newBytes, 0, len);
			--newBytes[len - 1];
		}
		return new BinaryField(newBytes);
	}
Fill record with random data that falls int the middle range for
the value type. The middle range is considered form half the min value
to half the max value. It only applies to byte, short, int, and long currently.
@param rec record
@param varDataSize number of bytes to fill into all variable length fields.
A value less than 0 results in a null assignment to those fields.
Ghidra/Framework/DB/src/test/java/db/DBTestUtils.java