@Test
	public void testInstallingNewExtension_SameName_NewVersion_Cancel() throws Exception {

		// install extension Foo with Ghidra version
		File buildFolder = createTempDirectory(BUILD_FOLDER_NAME);
		String appVersion = Application.getApplicationVersion();
		File extensionFolder =
			doCreateExternalExtensionInFolder(buildFolder, TEST_EXT_NAME, appVersion);
		assertTrue(ExtensionInstaller.install(extensionFolder));

		// create another extension Foo v2
		File buildFolder2 = createTempDirectory("TestExtensionParentDir2");
		String newVersion = "v2";
		File extensionFolder2 =
			doCreateExternalExtensionInFolder(buildFolder2, TEST_EXT_NAME, newVersion);

		AtomicBoolean didInstall = new AtomicBoolean();
		runSwingLater(() -> {
			didInstall.set(ExtensionInstaller.install(extensionFolder2));
		});

		DialogComponentProvider confirmDialog = waitForDialogComponent("Duplicate Extension");
		pressButtonByText(confirmDialog, "Cancel");
		waitForSwing();

		assertExtensionInstalled(TEST_EXT_NAME, appVersion);
		assertExtensionNotInstalled(TEST_EXT_NAME, newVersion);
	}
Tests for the {@link ExtensionInstaller} class.
Ghidra/Framework/Project/src/test/java/ghidra/framework/project/extensions/ExtensionInstallerTest.java