private List<Structure> getClassStructures(Category[] categories) throws CancelledException {

		List<Structure> classStructures = new ArrayList<Structure>();

		for (Category category : categories) {
			monitor.checkCancelled();
			DataType[] dataTypes = category.getDataTypes();
			for (DataType dataType : dataTypes) {
				monitor.checkCancelled();

				// if the data type name is the same as the folder name then
				// it is the main class structure so add it
				if (dataType.getName().equals(category.getName()) &&
					dataType instanceof Structure) {

					Structure classStructure = (Structure) dataType;
					classStructures.add(classStructure);
				}
			}

			Category[] subcategories = category.getCategories();

			if (subcategories.length > 0) {
				classStructures.addAll(getClassStructures(subcategories));
			}
		}
		return classStructures;
	}
Method to update the given function definition with the new function definition
@param functionDefinition the given function definition
@param newFunctionDefinition the new function definition
@return the new function definition or null if not changed
Ghidra/Features/Decompiler/ghidra_scripts/classrecovery/RecoveredClassHelper.java