@Override public Wom3DefinitionListDef replaceDef(int index, Wom3DefinitionListDef def) throws IndexOutOfBoundsException { Backbone parent = getParentNode(); if (parent != null) { Wom3DefinitionListDef old = getDef(index); // Is expected to assertWritable(); parent.replaceChild(def, old); return old; } else { assertWritableOnDocument(); return defs.set(index, def); } }