Question: are class invariants inherent to code?
Answer: The class invariant constrains the state stored in the object. Class invariants are established during construction and constantly maintained between calls to public methods. Code within functions may break invariants as long as the invariants are restored before a public function ends.