@Test
	public void testCyclicDependencyProblem6() {
		Union structure = createUnion("TestStructure");
		structure.add(union);
		try {
			union.add(structure);
			Assert.fail(
				"Shouldn't be able to add a structure, which contains this union, to this union.");
		}
		catch (IllegalArgumentException e) {
			// Should get an exception from adding the union to itself.
		}
		try {
			union.insert(0, structure);
			Assert.fail(
				"Shouldn't be able to insert a structure, which contains this union, to this union.");
		}
		catch (IllegalArgumentException e) {
			// Should get an exception from inserting the union to itself.
		}
	}
Test that a union can't contain a structure that contains that union.
Ghidra/Features/Base/src/test/java/ghidra/program/model/data/UnionDataTypeTest.java