private static boolean findTerminator(Function function, TaskMonitor monitor)
			throws CancelledException {
		boolean retFound = false;
		AddressSetView body = function.getBody();
		CodeUnitIterator codeUnitIterator =
			function.getProgram().getListing().getCodeUnits(body, true);
		while (codeUnitIterator.hasNext()) {
			monitor.checkCancelled();
			CodeUnit codeUnit = codeUnitIterator.next();
			if (codeUnit instanceof Instruction) {
				Instruction instruction = (Instruction) codeUnit;
				if (instruction.getFlowType().isTerminal()) {
					retFound = true;
					break;
				}
			}
		}
		return retFound;
	}
Looks for a terminating flow within a function body, returning whether it was found.
@param function the function
@param monitor a task monitor
@return if a terminating flow was found in the function body
@throws CancelledException if the user cancels
Ghidra/Features/FunctionID/src/main/java/ghidra/feature/fid/service/FidServiceLibraryIngest.java