Source: http://www.iro.umontreal.ca/~dift1020/cours/ift1020/communs/Cours/C8/Collections.pdf