Coding exercise requiring a interface implementation with HashMap usage