Its a static method in SimpleTagSupport class.
You must have read the
JavaDocs for this method.
For understanding how it works, here is the source code from
Tomcat implementation:
Read the code above, its pretty straightforward to see how it has been implemented (see the for loop above).
I think now you can write an example yourself. Isn't it?