1. A method of ensuring that invariants are preserved within a data structure, the method comprising: executing multiple threads on a computer; a thread T 1 acquiring a lock on a top hierarchical object; wherein acquiring the lock changes ownership to thread T 1 of the top object; wherein ownership confers upon thread T 1 the right to modify any field of the owned object; and wherein the lock excludes all other threads from accessing the top object and any descendant objects.