@Test
	public void testSaveTool() throws Exception {

		// Make sure old tool instance does not exist
		ToolChest toolChest = project.getLocalToolChest();
		toolChest.remove(TOOL_NAME);

		// create a new running tool
		runSwing(new Runnable() {
			@Override
			public void run() {
				runningTool = ProjectTestUtils.getTool(project, null);
			}
		});

		ToolTemplate toolTemplate = null;
		try {

			// set the name of the tool to what the user will enter in a "Save" dialog
			runningTool.setToolName(TOOL_NAME);

			// save the tool to the project tool chest
			ProjectTestUtils.saveTool(project, runningTool);

			// verify the project tool chest now contains the saved tool
			toolTemplate = toolChest.getToolTemplate(TOOL_NAME);
			if (toolTemplate == null) {
				Assert.fail(TOOL_NAME + " was not saved to tool chest!");
				return;
			}

			toolChest.addToolTemplate(toolTemplate);

			// verify the new name is different than the original name
			assertTrue("The tool config's name was not changed when adding a tool with a " +
				"duplicate name.", !TOOL_NAME.equals(toolTemplate.getName()));
		}
		finally {
			runSwing(new Runnable() {
				@Override
				public void run() {
					runningTool.close();
				}
			});

			toolChest.remove(TOOL_NAME);
			ProjectTestUtils.deleteTool(project, TOOL_NAME);
			if (toolTemplate != null) {
				toolChest.remove(toolTemplate.getName());
				ProjectTestUtils.deleteTool(project, toolTemplate.getName());
			}
		}
	}
Test for creating a new empty tool with the new front end
Ghidra/Features/Base/src/test.slow/java/ghidra/framework/project/tool/SaveToolTest.java