Maybe we should allow to specify an upper limit for the HashMap so it is possible to bound it.