Using a map of data populated from the Lincoln Home National Historic Site we will use map.count
with a groovy closure to count the number of times a key and a value occur. A comparable example demonstrates how to count keys or values in a java hashmap.
Count Keys
Count values