private void fixupActiveFunctions() {
		Function left = getActiveFunction(LEFT);
		Function right = getActiveFunction(RIGHT);
		boolean containsLeft = functions.contains(left);
		boolean containsRight = functions.contains(right);
		if (containsLeft && containsRight) {
			return;
		}

		Function firstFunction = functions.isEmpty() ? null : getOrderedFunctions().get(0);

		if (!containsLeft) {
			left = firstFunction;
		}
		if (!containsRight) {
			right = firstFunction;
		}

		activeFunctions = new Duo<>(left, right);
	}
Basic FunctionComparisonModel where a set of functions can be compared with each other
Ghidra/Features/Base/src/main/java/ghidra/features/base/codecompare/model/AnyToAnyFunctionComparisonModel.java