public T[] next() {
		T[] nextComps =
			(T[]) java.lang.reflect.Array.newInstance(comps.getClass().getComponentType(),
				comps.length);
		// Get a next value from each variable array
		for (int i = 0; i < compArrays.length; i++) {
			if (comps[i] == null) {
				if ((indices[i] >= 0) && (indices[i] < compArrays[i].length)) {
					comps[i] = compArrays[i][indices[i]];
				}
			}
		}

		// Find next variable.
		T compNext = null;
		boolean next[] = new boolean[comps.length];
//		for (int i = (forward ? 0 : comps.length-1); 
//				(forward ? (i < comps.length) : (i >= 0)); 
//				i=(forward ? i+1 : i-1)) {
		for (int i = 0; i < comps.length; i++) {
			if (comps[i] == null) {
				continue;
			}
			if (compNext == null) {
				compNext = comps[i];
				next[i] = true;
			}
			else {
				int result = compNext.compareTo(comps[i]);
				if (result == 0) {
					next[i] = true;
				}
				else if ((forward && (result > 0)) || (!forward && (result < 0))) {
					compNext = comps[i];
					for (int n = 0; n < i; n++) {
						next[n] = false;
					}
					next[i] = true;
				}
			}
		}

		// Return next comparable object(s) or nulls if none.
		for (int i = 0; i < comps.length; i++) {
			if (next[i]) {
				nextComps[i] = comps[i];
				comps[i] = null;
				if (forward) {
					indices[i]++;
				}
				else {
					indices[i]--;
				}
			}
		}
		return nextComps;
	}
Returns the next comparable object(s). The next object could be from any 
one or more of the arrays. The object array returned corresponds to the 
comparable arrays originally passed to the constructor. All objects 
returned are effectively the same as determined by the compareTo() method. 
If the next object for one of the original comparable arrays is not the 
same as the next overall object, then a null is returned in its place.

@return an array with the next object found for each of the original arrays.
Some of these may be null, indicating the corresponding comparable array 
didn't possess the next object. However, that comparable array may still 
have objects on subsequent calls.
There will be as many elements in this array as the number of comparable 
arrays passed to the constructor.
Ghidra/Features/Base/src/main/java/ghidra/util/MultiComparableArrayIterator.java