public static function checkImmutability($object, array $array)
    {
        $exception = new UnauthorizedModificationException($object);
        foreach ($array as $key => $previousValue) {
            $methodName = 'get'.ucfirst($key);
            if ($previousValue != $object->$methodName()) {
                $exception->addModifiedProperty($key);
            }
        }

        if ($exception->hasModifiedProperty()) {
            throw $exception;
        }
    }