private void createNestedStructures(Program p, StructureDataType structureDataType, int offset,
			int length) {

		StructureDataType nestedStructureDataType =
			new StructureDataType("NESTED_STRUCTURE_" + offset, length);

		ByteDataType byteDataType = new ByteDataType(p.getDataTypeManager());
		structureDataType.replaceAtOffset(0, byteDataType, 1, "", "");
		structureDataType.replaceAtOffset(1, nestedStructureDataType, length,
			"NESTED_STRUCTURE_" + offset, "");

		length--;
		offset++;

		if (length > 0) {
			createNestedStructures(p, nestedStructureDataType, offset, length);
		}
	}
Function that will create a composite structure that contains nested structures
Once the function is made the function will call {@link #createNestedStructures(StructureDataType, int, int)}
Ghidra/Features/Base/src/test.slow/java/ghidra/app/plugin/core/scalartable/ScalarSearchTest.java