@Test
	public void testMinStringLength() throws Exception {

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

		Listing listing = testProgram.getListing();
		AddressSpace space = testProgram.getLanguage().getAddressFactory().getDefaultAddressSpace();

		// Test strings
		String[] existingStrings = new String[] { "drm/duration", "PVFMVideoMIO",
			"set to invalid mode (%d)", "device", "height", "PLAYER_QUIT", "video/decoder" };
		int[] offsets = new int[] { 0xa7198120, 0xa7195fd4, 0xa7196ee8, 0xa717fa48, 0xa71956a0,
			0xa7197304, 0xa718025c };

		// Sort strings by length
		TreeMap<Integer, List<String>> stringsBySize = new TreeMap<>();
		HashMap<String, Address> stringToAddr = new HashMap<>();

		int strLen;

		for (int i = 0; i < existingStrings.length; i++) {
			stringToAddr.put(existingStrings[i], addr(space, offsets[i]));

			strLen = existingStrings[i].length();

			if (!stringsBySize.containsKey(strLen)) {
				List<String> tempArr = new ArrayList<>();
				tempArr.add(existingStrings[i]);
				stringsBySize.put(strLen, tempArr);
			}
			else {
				stringsBySize.get(strLen).add(existingStrings[i]);
			}
		}

		Data dataHere;

		// Verify none of these strings exist prior to running the Strings Analyzer
		for (String candidateStr : stringToAddr.keySet()) {
			dataHere = listing.getDefinedDataAt(stringToAddr.get(candidateStr));
			assertNull(dataHere);
		}

		AutoAnalysisManager manager = AutoAnalysisManager.getAnalysisManager(testProgram);

		// Run strings analyzer for each string length
		StringsAnalyzer analyzer = new StringsAnalyzer();

		List<Integer> strSizes = new ArrayList<>(stringsBySize.keySet());
		String stringHere;

		// First verify that setting min string size to one greater than largest string
		// will result in none of the test strings being made
		analyzer.setMinStringLength(strSizes.get(strSizes.size() - 1) + 1);
		analyzer.setStringEndAlignment(1);
		analyzer.added(testProgram, null, monitor, manager.getMessageLog());

		for (String candidateStr : stringToAddr.keySet()) {
			dataHere = listing.getDefinedDataAt(stringToAddr.get(candidateStr));
			assertNull("Did not expect to find '" + candidateStr +
				"' when min string length is set to " + strSizes.get(strSizes.size() - 1) + 1,
				dataHere);
		}

		// Now decrease min string size to equivalent to each of test string sizes, run analyzer,
		// and verify that expected strings are/aren't created
		for (int j = strSizes.size() - 1; j >= 0; j--) {
			int minStrLen = strSizes.get(j);

			// Run analyzer with min string size equal to size of current set of strings
			analyzer.setMinStringLength(strSizes.get(j));
			analyzer.added(testProgram, null, monitor, manager.getMessageLog());

			// Verify that strings below this size do not exist
			for (int k = 0; k < j; k++) {
				for (String thisString : stringsBySize.get(strSizes.get(k))) {
					dataHere = listing.getDefinedDataAt(stringToAddr.get(thisString));
					assertNull("Did not expect to find: '" + thisString +
						"' when min str length is set to " + minStrLen, dataHere);
				}
			}

			// Verify that strings this size and higher do exist
			for (int k = j; k < strSizes.size(); k++) {
				for (String thisString : stringsBySize.get(strSizes.get(k))) {
					// Verify string is actually there
					dataHere = listing.getDefinedDataAt(stringToAddr.get(thisString));
					assertNotNull("Expected to find: '" + thisString +
						"' when min string length is set to " + minStrLen, dataHere);
					stringHere = dataHere.getDefaultValueRepresentation();

					assertEquals("\"" + thisString + "\"", stringHere);
				}
			}
		}
	}
Test that the minimum string length parameter works -- strings shorter than the minimum
string length should not be created.
Ghidra/Features/Base/src/test.slow/java/ghidra/app/plugin/core/string/StringsAnalyzerTest.java