@Test
	public void testReplaceWith2() throws InvalidDataTypeException {

		// NOTE: pack(disabled) bitfields should remain unchanged when
		// transitioning endianness even though it makes little sense.
		// pack(disabled) structures are not intended to be portable! 

		TypeDef td = new TypedefDataType("Foo", IntegerDataType.dataType);

		struct.insertBitFieldAt(9, 1, 0, td, 4, "MyBit1", "bitComment1");
		struct.insertBitFieldAt(9, 1, 4, td, 3, "MyBit2", "bitComment2");
		struct.insertBitFieldAt(9, 2, 7, td, 2, "MyBit3", "bitComment3");
		struct.growStructure(1);

		struct.add(new ArrayDataType(td, 0, -1), "myFlex", "flexComment");

		//@formatter:off
		CompositeTestUtils.assertExpectedComposite(this, "/TestStruct\n" + 
			"pack(disabled)\n" + 
			"Structure TestStruct {\n" + 
			"   0   byte   1   field1   \"Comment1\"\n" + 
			"   1   word   2      \"Comment2\"\n" + 
			"   3   dword   4   field3   \"\"\n" + 
			"   7   byte   1   field4   \"Comment4\"\n" + 
//			"   8   undefined   1      \"\"\n" + 
			"   9   Foo:4(0)   1   MyBit1   \"bitComment1\"\n" + 
			"   9   Foo:3(4)   1   MyBit2   \"bitComment2\"\n" + 
			"   9   Foo:2(7)   2   MyBit3   \"bitComment3\"\n" + 
//			"   11   undefined   1      \"\"\n" + 
			"   12   Foo[0]   0   myFlex   \"flexComment\"\n" + 
			"}\n" + 
			"Length: 12 Alignment: 1", struct);
		//@formatter:on

		DataTypeManager beDtm = createBigEndianDataTypeManager();

		Structure newStruct = new StructureDataType("bigStruct", 0, beDtm);
		newStruct.replaceWith(struct);

		assertTrue(newStruct.getDataOrganization().isBigEndian());

		//@formatter:off
		CompositeTestUtils.assertExpectedComposite(this, "/bigStruct\n" + 
			"pack(disabled)\n" + 
			"Structure bigStruct {\n" + 
			"   0   byte   1   field1   \"Comment1\"\n" + 
			"   1   word   2      \"Comment2\"\n" + 
			"   3   dword   4   field3   \"\"\n" + 
			"   7   byte   1   field4   \"Comment4\"\n" + 
//			"   8   undefined   1      \"\"\n" + 
			"   9   Foo:4(0)   1   MyBit1   \"bitComment1\"\n" + 
			"   9   Foo:3(4)   1   MyBit2   \"bitComment2\"\n" + 
			"   9   Foo:2(7)   2   MyBit3   \"bitComment3\"\n" + 
//			"   11   undefined   1      \"\"\n" + 
			"   12   Foo[0]   0   myFlex   \"flexComment\"\n" + 
			"}\n" + 
			"Length: 12 Alignment: 1", newStruct);
		//@formatter:on
	}
/Test
pack(disabled)
Structure Test {
   0   byte   1   field1   "Comment1"
   2   word   2      "Comment2"
   4   dword   4   field3   ""
   8   byte   1   field4   "Comment4"
   9   char[0]   0   zarray1   ""
   12   long   4   field4   ""
   16   long[0]   0   zarray2   ""
}
Length: 16 Alignment: 1
Ghidra/Features/Base/src/test/java/ghidra/program/model/data/StructureDataTypeTest.java