@Test
	public void testReplaceWith() {
		assertEquals(8, struct.getLength());
		assertEquals(4, struct.getNumComponents());

		Structure newStruct = createStructure("Replaced", 8);
		newStruct.setDescription("testReplaceWith()");
		DataTypeComponent dtc0 = newStruct.insert(2, new ByteDataType(), 1, "field3", "Comment1");
		DataTypeComponent dtc1 = newStruct.insert(5, new WordDataType(), 2, null, "Comment2");
		DataTypeComponent dtc2 = newStruct.insert(7, new DWordDataType(), 4, "field8", null);

		struct.replaceWith(newStruct);
		assertEquals(15, struct.getLength());
		assertEquals(11, struct.getNumComponents());
		DataTypeComponent[] dtcs = struct.getDefinedComponents();
		assertEquals(3, dtcs.length);
		assertEquals(dtc0, dtcs[0]);
		assertEquals(dtc1, dtcs[1]);
		assertEquals(dtc2, dtcs[2]);
		assertEquals("TestStruct", struct.getName());
		assertEquals("", struct.getDescription());
	}
/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