formatList((List)anObject);
}
else if (anObject instanceof DebugState) {
// print the debug state if any. However if the debug
// state is the object itself, just toString it.
DebugState debugState = (DebugState)anObject;
Object newObj = debugState.debugState();
if (debugState == newObj) {
serializeString(anObject.toString());
}
else {
formatObject(newObj);