I have the following HashMap:

```java
HashMap<Integer, Object> ItemsData = new HashMap<Integer, Object>();

```

In the HashMap, I have objects of various classes, such as

* ClassOne
* ClassTwo
* ClassThree

Each class has its own methods, attributes etc.
How do I refer to proper method, depending on the instance of the class?

For example:

* `ItemsData.get(5).bark()` -> because item 5 is instance of class 1 which has method bark
* `ItemsData.get(2).jump()` -> because item 2 is instance of class 2 which has method jump
* `ItemsData.get(6).fire()` -> because item 6 is instance of class 3 which has method fire