private void setInUse(DomainFile df, String path) throws Exception {
		ProgramDB program = createDefaultProgram("test1", ProgramBuilder._TOY, this);

		//
		// 					Unusual Code Alert!
		// We are calling an internal method to trigger the 'in use' state, as it is much
		// faster to do this than it is to open a program in a tool!
		//

		//@formatter:off
		Object projectData = getInstanceField("projectData", df);
		invokeInstanceMethod("setDomainObject", projectData,
			new Class[] { String.class, 	DomainObjectAdapter.class },
			new Object[] { path, program }
				);
		//@formatter:on
	}
Tests for actions in the front end (Ghidra project window)
Ghidra/Features/Base/src/test.slow/java/ghidra/framework/main/datatree/FrontEndPluginActionsTest.java