StackMap extends the basic hashmap type by adding a limit to the number of items contained at any given time. In addition, StackMap retains the order in which elements were added, and employs that during foreach() traversal. Additions to the map beyond the capacity will result in an exception being thrown.