@Test
	public void testForceReloadModels() throws Exception {

		Program testProgram = buildProgram("libopencoreplayer.so", false);

		// Strings that will only be found in the "good" (regular) model
		String[] stringsInGoodModel = new String[] { "device", "video/decoder", "player" };
		int[] goodStringOffsets = new int[] { 0xa717fa48, 0xa718025c, 0xa71802a8 };
		Address[] goodStringAddresses = new Address[goodStringOffsets.length];

		// Strings that will only be found in the "bad" (contrived) model
		String[] stringsInBadModel = new String[] { "tnihtxetL\\t", "OMXAacDec", "rBBASepzNnLr" };
		int[] badStringOffsets = new int[] { 0xa71756c4, 0xa7192c00, 0xa7192fa0 };
		Address[] badStringAddresses = new Address[badStringOffsets.length];

		AddressSpace space = testProgram.getLanguage().getAddressFactory().getDefaultAddressSpace();

		for (int i = 0; i < goodStringOffsets.length; i++) {
			goodStringAddresses[i] = addr(space, goodStringOffsets[i]);
		}

		for (int i = 0; i < badStringOffsets.length; i++) {
			badStringAddresses[i] = addr(space, badStringOffsets[i]);
		}

		// Run as usual, verify that "good model" strings exist, but not "bad model" strings.
		AutoAnalysisManager manager = AutoAnalysisManager.getAnalysisManager(testProgram);

		StringsAnalyzer analyzer = new StringsAnalyzer();
		analyzer.setStringEndAlignment(1);

		analyzer.added(testProgram, null, monitor, manager.getMessageLog());

		// Verify these strings don't exist
		Data dataHere;
		Listing listing = testProgram.getListing();

		for (Address currAddress : badStringAddresses) {
			dataHere = listing.getDefinedDataAt(currAddress);
			assertNull(dataHere);
		}

		// Verify these strings exist
		String stringHere;
		for (int i = 0; i < stringsInGoodModel.length; i++) {
			// Verify string is actually there
			dataHere = listing.getDefinedDataAt(goodStringAddresses[i]);
			assertNotNull(dataHere);
			stringHere = dataHere.getDefaultValueRepresentation();

			// String will look something like --> "My String",00
			String buildMyString = "\"" + stringsInGoodModel[i] + "\"";
			assertEquals(buildMyString, stringHere);
		}

		// Create and load the "bad" model -- needs to be in the same directory as current model
		List<ResourceFile> modelFiles = Application.findFilesByExtensionInApplication(".sng");

		if (modelFiles.size() == 0) {
			Assert.fail("Could not find directory containing the .sng string n-grams model!");
		}

		// Use the first result for reference (there should only be one result)
		ResourceFile containingFolder = modelFiles.get(0).getParentFile();
		File tempFile = new File(containingFolder.getFile(true), "tempStringNGrams.sng");

		tempFile.delete();

		try {
			boolean createSuccess = tempFile.createNewFile();
			assertTrue("File '" + tempFile.getAbsolutePath() + "' should have been created!",
				createSuccess);

			FileWriter output = new FileWriter(tempFile);
			BufferedWriter writer = new BufferedWriter(output);
			writer.write("# Model Type: lowercase\n\n");

			// Basic model where all trigrams made up of the letters a - z have the same probability
			for (int first = 'a'; first <= 'z'; first++) {
				for (int second = 'a'; second <= 'z'; second++) {
					for (int third = 'a'; third <= 'z'; third++) {
						writer.write(
							(char) first + "\t" + (char) second + "\t" + (char) third + "\t500\n");
					}
				}
			}

			writer.close();

			// Leave off extension; the file should still be found correctly
			analyzer.setModelName("tempStringNGrams");
			analyzer.setForceModelReload(true);

			analyzer.added(testProgram, null, monitor, manager.getMessageLog());

			// Verify the "bad" strings now exist
			for (int i = 0; i < stringsInBadModel.length; i++) {
				// Verify string is actually there
				dataHere = listing.getDefinedDataAt(badStringAddresses[i]);
				assertNotNull("Expecting " + stringsInBadModel[i] + " at " + badStringOffsets[i],
					dataHere);
				stringHere = dataHere.getDefaultValueRepresentation();

				// String will look something like --> "My String",00
				String buildMyString = "\"" + stringsInBadModel[i] + "\"";
				assertEquals(buildMyString, stringHere);
			}

		}
		finally {
			tempFile.delete();
		}
	}
Test that checking the "force reload" box and assigning a new model file results in
a new model being loaded and different strings being found.

@throws Exception
Ghidra/Features/Base/src/test.slow/java/ghidra/app/plugin/core/string/StringsAnalyzerTest.java