My cousin's dog was kept in an invisible fence. This dog figured out that the collar would beep when he approached the fence. He also figured out that, when it stopped beeping, it meant that the batteries were dead and there would be no shock. So that dog would walk back and forth, with that collar beeping like crazy, until the beeping stopped and he could escape without a jolt. Needless to say, that was the end of their invisible fence

I'll save my rant about invisible fences and conditioned fear and aggression for another day....