private Function createFunction(String name, Address entryPt, AddressSetView body) {
		try {
			FunctionManager functionManager = program.getFunctionManager();
			functionManager.createFunction(name, entryPt, body, SourceType.USER_DEFINED);
			return functionManager.getFunctionAt(entryPt);
		}
		catch (Exception exc) {
			StringWriter stringWriter = new StringWriter();
			PrintWriter writer = new PrintWriter(stringWriter);
			exc.printStackTrace(writer);
			Assert.fail("Unable to create function \"" + name + "\" at address: " + entryPt +
				". Exception info: " + stringWriter);
		}

		return null;
	}
Tests the deleting of functions via the {@link DeleteFunctionCmd}.
Ghidra/Features/Base/src/test/java/ghidra/app/cmd/function/DeleteFunctionCmdTest.java