public void updateFunction(Function f, boolean customStorage, DataType returnType,
			Parameter... params) {
		startTransactions();
		try {
			for (Program p : programs) {

				Function function = findMatchingFunction(p, f);

				function.setCustomVariableStorage(customStorage);

				try {
					if (returnType != null) {
						function.setReturnType(returnType, SourceType.ANALYSIS);

					}

					for (Parameter param : params) {
						function.addParameter(param, SourceType.USER_DEFINED);
					}

				}
				catch (Exception e) {
					throw new RuntimeException("Exception updating function", e);
				}
			}
		}
		finally {
			endTransations();
		}
	}
A special test 'program-like' class that allows clients to *easily* make changes one
or more programs.  This is useful for merge tests, which need to setup an environment
that is the same for many different programs.
Ghidra/Features/Base/src/test/java/ghidra/program/database/MergeProgram.java