How to add open/closed icon to Twitter Bootstrap accordions

If using Bootsrap 3, there is a very fast and unobtrusive way to add open/closed icon to accordions.
Pure CSS, no extra js needed:

We use CSS pseudo-selector :after and we animate the icon using CSS3 rotate transform property. For the icon we can use the Glyphicons library (yet integrated in Bootstrap 3).

To make it work we now just need to add a class="collapsed" to any anchor tags that are closed by default.

So the Bootstrap HTML result will be something like this: