@Test
	public void testReplaceWithStructureContainingReplacedStructure() {
		int txId = program.startTransaction("Add Struct");

		Structure struct1 = createStruct("abc", new ByteDataType(), 10);
		DataType resolvedStruct1 = dtm.resolve(struct1, null);

		Structure struct2 = createStruct("abc", resolvedStruct1, 1);

		// Replacement type refers to existing type preventing existing type from being removed
		// Resolve reverts to default add behavior producing a conflict name
		// Uncertain if a dependency exception should be thrown instead

		DataType resolvedStruct2 = dtm.resolve(struct2, DataTypeConflictHandler.REPLACE_HANDLER);

		assertEquals("abc", struct1.getName());
		assertEquals("abc", struct2.getName());

		assertEquals("abc.conflict", resolvedStruct2.getName());

		assertTrue(
			resolvedStruct1.equals(((Structure) resolvedStruct2).getComponentAt(0).getDataType()));

		program.endTransaction(txId, true);

	}
Tests for manipulating data types in the category/data type tree.
Ghidra/Features/Base/src/test.slow/java/ghidra/program/model/data/DataTypeTest.java