Most every helmet is a single impact helmet. This means that, when in mint condition, the helmet can protect you only once. If you toss your helmet around, throw it, abuse it anyway you are dramatically reducing its effectiveness in keeping you safe.  If your helmet looks like it needs replacing, it most likely really really does. A good rule of thumb is if you take a fall and you say "wow I'm glad I had my helmet on" you need to replace it.  If you are wondering about the integrity  of your helmet, replace it- you only get one head so take care of it.
Multiple impact helmets are designed to have the foam rebound after your first impact so they can absorb another impact, but this is actually scary- there is no way to know if this happened or to what extent it rebouned, or how many rebounds it will make.  It could very well die on the first impact and not work again and this is what is scary becaue you think it will. So potentially you are riding an expired helmet when you think it will last another impact. And you only find out when the helmet doesn't protect you.
When in doubt, if you sustain a fall on any helmet, replace it.  If your helmet looks beat, replace it.