@Test
	public void testCyclicDependencyProblem5() {
		Union anotherUnion = createUnion("AnotherUnion");
		TypeDef typeDef = createTypeDef(union);
		anotherUnion.add(typeDef);
		try {
			union.add(anotherUnion);
			Assert.fail(
				"Shouldn't be able to add another union, which contains a typedef of this union, to this union.");
		}
		catch (IllegalArgumentException e) {
			// Should get an exception from adding the union to itself.
		}
		try {
			union.insert(0, anotherUnion);
			Assert.fail(
				"Shouldn't be able to insert another union, which contains a typedef of 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 another union that contains a typedef to it.
Ghidra/Features/Base/src/test/java/ghidra/program/model/data/UnionDataTypeTest.java