private void changeOldOption(String newValue) {
		Options programAnalysisOptions = program.getOptions(Program.ANALYSIS_PROPERTIES);
		Options options = programAnalysisOptions.getOptions(AbstractTestStubAnalyzer.NAME);
		AbstractOptions abstractOptions = (AbstractOptions) getInstanceField("options", options);

		// this call creates an 'unregistered option'
		String fullOptionName =
			"Analyzers." + AbstractTestStubAnalyzer.NAME + '.' + OLD_OPTION_NAME;
		Option option = abstractOptions.getOption(fullOptionName,
			OptionType.getOptionType(OLD_OPTION_DEFAULT_VALUE), OLD_OPTION_DEFAULT_VALUE);

		// during testing 'value' may or may not match the default value
		tx(program, () -> {
			option.setCurrentValue(newValue);
			setInstanceField("isRegistered", option, false);
		});
	}
This class test the ability to replace analysis options using an {@link AnalysisOptionsUpdater}.
Ghidra/Features/Base/src/test.slow/java/ghidra/app/plugin/core/analysis/AnalysisOptions2Test.java