title: Check if Object is instance of String, HashMap, or HashMap[ ]
body: <p>I have an Object in java. Is there a way to check if an object is an instance of a String, HashMap, or HashMap[ ] before actually casting it to those objects? </p>
  
  <p>If not, as it seems counterintuitive that the above would work, is there a way to cast it into each object, and test something about the newly casted object to see if its in fact the type of object into which it was casted?</p>