That would likely work, but extending any concrete class can get you in trouble with the Liskov Substitution Principle and long term maintenance. It would be safer (and more effort, and some additional overhead) to provide a new class that implements a get() and put() interface and happens to use a HashMap inside.
See
Extends is Evil. I think Holub is deliberately provocative and over the top, but there are some nuggets in there.