@Test
	public void testSetTypedefDefaultSettings() throws Exception {

		TypeDef typeDef = new TypedefDataType(CategoryPath.ROOT, "ByteTypedef",
			new ByteDataType(dataMgr), dataMgr);

		assertEquals(0, ByteDataType.dataType.getTypeDefSettingsDefinitions().length);

		Settings defaultSettings = typeDef.getDefaultSettings();

		// immutable warnings expected
		FormatSettingsDefinition.DEF.setChoice(defaultSettings, FormatSettingsDefinition.CHAR);
		EndianSettingsDefinition.DEF.setBigEndian(defaultSettings, false);
		PaddingSettingsDefinition.DEF.setPadded(defaultSettings, true);

		assertNull(defaultSettings.getLong("format"));
		assertNull(defaultSettings.getLong("endian"));
		assertNull(defaultSettings.getLong("padding"));

		// May modify arbitrary typedef default settings after resolve
		typeDef = (TypeDef) dataMgr.resolve(typeDef, null);

		defaultSettings = typeDef.getDefaultSettings();
		FormatSettingsDefinition.DEF.setChoice(defaultSettings, FormatSettingsDefinition.CHAR);
		EndianSettingsDefinition.DEF.setBigEndian(defaultSettings, false);
		PaddingSettingsDefinition.DEF.setPadded(defaultSettings, true);

		assertEquals(FormatSettingsDefinition.CHAR, defaultSettings.getLong("format").longValue());
		assertEquals(EndianSettingsDefinition.LITTLE,
			defaultSettings.getLong("endian").longValue());
		assertEquals(PaddingSettingsDefinition.PADDED_VALUE,
			defaultSettings.getLong("padded").longValue());

		try {
			defaultSettings.setValue("format", Palette.RED);
			Assert.fail("Should not be able to set arbitrary objects");
		}
		catch (IllegalArgumentException e) {
			// expected
		}
	}
Test setting default and instance settings on Data.
Ghidra/Features/Base/src/test.slow/java/ghidra/program/database/data/SettingsTest.java