private MaskContainer combineInstructionMasks(List<byte[]> masks, List<byte[]> values) {

		// If the byte arrays aren't the same size then we have a problem; definitely throw
		// something.
		if (masks.size() != values.size()) {
			throw new IllegalArgumentException();
		}

		// Now figure out the size of the final array we need to construct.  We 
		// could use ArrayList objects instead but that would be too inefficient.
		int totalLength = 0;
		for (int i = 0; i < values.size(); i++) {
			totalLength += values.get(i).length;
		}

		// This takes the masks and values from each command and concats them together to form
		// a single mask and value byte array. 
		byte[] value = new byte[totalLength];
		byte[] mask = new byte[totalLength];

		int index = 0;
		for (int x = 0; x < values.size(); x++) {
			for (int i = 0; i < values.get(x).length && index < totalLength; i++) {
				value[index] = values.get(x)[i];
				mask[index] = masks.get(x)[i];
				index++;
			}
		}

		MaskContainer container;
		try {
			container = new MaskContainer(mask, value);
		}
		catch (IllegalArgumentException e) {
			return null;
		}

		return container;
	}
Creates a {@link MaskContainer} object representing the bytes to be
searched for, along with any masking information.

@param masks List of all masks for all instructions
@param values List of all values for all instructions
Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/instructionsearch/model/InstructionSearchData.java