protected void manipulateFormatSettings(boolean testDefaultSetting, boolean insideStruct,
			boolean commonStruct, Data data1, Data data2) throws Exception {

		assertTrue(data1.getDataType() == data2.getDataType());

		boolean settingsAreShared =
			testDefaultSetting && (!insideStruct || (insideStruct && commonStruct));

		if (data1.isArray()) {
			data1 = data1.getComponent(0);
		}
		if (data2.isArray()) {
			data2 = data2.getComponent(0);
		}

		byte[] bytes1 = data1.getBytes();
		byte[] bytes2 = data2.getBytes();
		int byteCnt = bytes1.length;
		DataType dt = data1.getDataType();

		boolean testEndianSetting = (bytes1.length > 1);
		String[] settingNames = testEndianSetting ? new String[] { "Format", "Padding", "Endian" }
				: new String[] { "Format", "Padding" };

		ArrayList<String[]> cases = new ArrayList<>();
		String[] settings = new String[testEndianSetting ? 3 : 2];
		for (String element : FORMAT_CHOICES) {
			if ("decimal".equals(element)) {
				continue;// Defer testing of Decimal format with SIGN setting
			}
			settings[0] = element;
			for (String element2 : PADDING_CHOICES) {
				settings[1] = element2;
				if (testEndianSetting) {
					for (String element3 : ENDIAN_CHOICES) {
						settings[2] = element3;
						cases.add(settings.clone());
					}
				}
				else {
					cases.add(settings.clone());
				}
			}
		}

		useDefaultSettings();
		changeSettings(true, settingNames, cases.get(0));

		// NOTE: default settings for the same datatype within different composites
		// is based upon the parent composite and not the stand-alone type.

		long val1 = getValue(bytes1, true);
		if (insideStruct && !commonStruct && dt instanceof CharDataType) {
			// Inside Struct: Component type format default Hex differs from the original default of Char
			assertEquals("Default setting", getCharString(val1, byteCnt),
				data1.getDefaultValueRepresentation());
		}
		else {
			assertEquals("Default setting", getHexString(val1, byteCnt, false),
				data1.getDefaultValueRepresentation());
		}

		long val2 = getValue(bytes2, true);
		assertEquals("Default setting", getHexString(val2, byteCnt, false),
			data2.getDefaultValueRepresentation());

		Iterator<String[]> iter = cases.iterator();
		while (iter.hasNext()) {
			settings = iter.next();

			boolean littleEndian = !(testEndianSetting && "big".equals(settings[2]));
			boolean pad = "padded".equals(settings[1]);

			String caseStr = (testDefaultSetting ? "Default " : "") + "Settings on " +
				(insideStruct ? (commonStruct ? "Common " : "") + "Structure " : "") +
				dt.getName() + ": " + settings[0] + "/" + settings[1];
			if (testEndianSetting) {
				caseStr += "/" + settings[2];
			}
//System.out.println(caseStr);

			changeSettings(testDefaultSetting, settingNames, settings);

			if (settingsAreShared) {
				val1 = getValue(bytes1, littleEndian);
			}
			else if (insideStruct && dt instanceof CharDataType) {
				assertEquals("Default setting applies", getCharString(val1, byteCnt),
					data1.getDefaultValueRepresentation());
			}
			else {
				assertEquals("Default setting applies", getHexString(val1, byteCnt, false),
					data1.getDefaultValueRepresentation());
			}

			val2 = getValue(bytes2, littleEndian);

			if ("char".equals(settings[0])) {
				// skip testing char format settings as those are tested in CharDataTypeRenderTest
			}
			else if ("binary".equals(settings[0])) {
				if (settingsAreShared) {
					assertEquals(caseStr, getBinaryString(val1, byteCnt, pad),
						data1.getDefaultValueRepresentation());
				}
				assertEquals(caseStr, getBinaryString(val2, byteCnt, pad),
					data2.getDefaultValueRepresentation());
			}
			else if ("octal".equals(settings[0])) {
				if (settingsAreShared) {
					assertEquals(caseStr, getOctalString(val1, byteCnt, pad),
						data1.getDefaultValueRepresentation());
				}
				assertEquals(caseStr, getOctalString(val2, byteCnt, pad),
					data2.getDefaultValueRepresentation());
			}
			else {// hex
				if (settingsAreShared) {
					assertEquals(caseStr, getHexString(val1, byteCnt, pad),
						data1.getDefaultValueRepresentation());
				}
				assertEquals(caseStr, getHexString(val2, byteCnt, pad),
					data2.getDefaultValueRepresentation());
			}

		}

		useDefaultSettings();
		changeSettings(true, settingNames, cases.get(0));

		val1 = getValue(bytes1, true);
		if (insideStruct && !commonStruct && dt instanceof CharDataType) {
			// Inside Struct: Component type format default Hex differs from the original default of Char
			assertEquals("Default setting", getCharString(val1, byteCnt),
				data1.getDefaultValueRepresentation());
		}
		else {
			assertEquals("Default setting", getHexString(val1, byteCnt, false),
				data1.getDefaultValueRepresentation());
		}

		val2 = getValue(bytes2, true);
		assertEquals("Default setting", getHexString(val2, byteCnt, false),
			data2.getDefaultValueRepresentation());

		settingNames =
			testEndianSetting ? new String[] { "Format", "Endian" } : new String[] { "Format" };

		cases.clear();

		settings = new String[testEndianSetting ? 2 : 1];
		settings[0] = "decimal";
		if (testEndianSetting) {
			for (String element2 : ENDIAN_CHOICES) {
				settings[1] = element2;
				cases.add(settings.clone());
			}
		}
		else {
			cases.add(settings.clone());
		}

		iter = cases.iterator();
		while (iter.hasNext()) {
			settings = iter.next();

			boolean littleEndian = !(testEndianSetting && "big".equals(settings[1]));
//			boolean unsigned = "unsigned".equals(settings[1]);

			String caseStr = (testDefaultSetting ? "Default " : "") + "Settings on " +
				(insideStruct ? (commonStruct ? "Common " : "") + "Structure " : "") +
				dt.getName() + ": " + settings[0];
			if (testEndianSetting) {
				caseStr += "/" + settings[1];
			}
//System.out.println(caseStr);

			changeSettings(testDefaultSetting, settingNames, settings);

			if (settingsAreShared) {
				val1 = getValue(bytes1, littleEndian);
			}
			else if (insideStruct && dt instanceof CharDataType) {
				assertEquals(caseStr + ", Default setting applies", getCharString(val1, byteCnt),
					data1.getDefaultValueRepresentation());
			}
			else {
				assertEquals(caseStr + ", Default setting applies",
					getHexString(val1, byteCnt, false), data1.getDefaultValueRepresentation());
			}

			val2 = getValue(bytes2, littleEndian);

			if (settingsAreShared) {
				assertEquals(caseStr, getDecimalString(val1, byteCnt, isUnsignedData(data1)),
					data1.getDefaultValueRepresentation());
			}

			assertEquals(caseStr, getDecimalString(val2, byteCnt, isUnsignedData(data2)),
				data2.getDefaultValueRepresentation());
		}

	}
Test FORMAT data setting (includes testing of SIGN, ENDIAN and PADDING setting)
@param testDefaultSetting if true test default setting, else test instance setting for data2
@param insideStruct data are inside two structure instances
@param commonStruct data structures are the same type
@param data1 data at some location with same type as data2
@param data2 data at current location
@throws Exception
Ghidra/Features/Base/src/test.slow/java/ghidra/app/plugin/core/data/AbstractDataActionTest.java