public <T> void markup(T obj, boolean nested) throws IOException, CancelledException {
		monitor.checkCancelled();
		if (obj == null) {
			return;
		}
		if (obj instanceof Collection<?> list) {
			for (Object listElement : list) {
				markup(listElement, nested);
			}
		}
		else if (obj.getClass().isArray()) {
			int len = Array.getLength(obj);
			for (int i = 0; i < len; i++) {
				markup(Array.get(obj, i), nested);
			}
		}
		else if (obj instanceof Iterator<?> it) {
			while (it.hasNext()) {
				Object itElement = it.next();
				markup(itElement, nested);
			}
		}
		else {
			StructureContext<T> structureContext =
				mappingContext.getStructureContextOfInstance(obj);
			if (structureContext == null) {
				throw new IllegalArgumentException();
			}
			monitor.increment();
			markupStructure(structureContext, nested);
		}
	}
Decorates the specified object's memory using the various structure mapping tags that 
were applied the object's class definition.
<p>
The object can be a structure mapped object, or a collection, array or iterator of structure
mapped objects.

@param <T> structure mapped object type
@param obj structure mapped object instance
@param nested boolean flag, if true the specified object is contained inside another object
who's data type has already been laid down in memory, removing the need for this object's
data type to be applied to memory 
@throws IOException if error or cancelled
@throws CancelledException if cancelled
@throws IllegalArgumentException if object instance is not a supported type
Ghidra/Features/Base/src/main/java/ghidra/app/util/bin/format/golang/structmapping/MarkupSession.java