public static PluginTool saveTool(final Project project, final PluginTool tool) {

		PluginTool newTool = runSwing(() -> {
			ToolChest toolChest = project.getLocalToolChest();
			ToolTemplate toolTemplate = tool.saveToolToToolTemplate();
			toolChest.replaceToolTemplate(toolTemplate);

			ToolManager toolManager = project.getToolManager();
			Workspace workspace = toolManager.getActiveWorkspace();
			tool.close();
			return workspace.runTool(toolTemplate);
		});

		return newTool;
	}
Save the given tool to the project tool chest.  If the tool already exists, then it will
be overwritten with the given tool.

@param project The project which with the tool is associated.
@param tool The tool to be saved
@return the new tool
Ghidra/Features/Base/src/main/java/ghidra/test/AbstractGhidraHeadedIntegrationTest.java