     override var representedObject: Any? {
         
         didSet {
+            assert(representedObject == nil || representedObject is Document,
+                   "representedObject of \(self.className) must be an instance of \(Document.className())")
+            
             self.observeDocument()
             self.observeSyntaxStyle()
             

    private var documentObserver: NSObjectProtocol?
    private var syntaxStyleObserver: NSObjectProtocol?
    private var selectionObserver: NSObjectProtocol?
    private var isOwnSelectionChange = false
    
    private var fontSizeObserver: UserDefaultsObservation?
    
    @IBOutlet private weak var outlineView: NSOutlineView?
    

            guard let self = self else { return assertionFailure() }
            
            self.observeSyntaxStyle()
            
            self.outlineView?.reloadData()
            self.invalidateCurrentLocation()
        }
    }
