Simplify AbstractValueObject::isSameAs() code.