I am currently learning Java and running into some trouble with simple Java code where I have to deal with a HashMap that has missing keys and values. 

Specifically, I am looking for an way to distinguish between the following two cases given a HashMap `myHashMap`:

1. `myHashMap.get("myKey")` is explicitly mapped to `null`
2. `myHashMap` does not contain an key for `"myKey"`

In looking around for a solution, I found the following in [documentation for the `get` method for HashMaps in Java 8 SE](https://docs.oracle.com/javase/8/docs/api/java/util/HashMap.html#containsKey-java.lang.Object-), which says that: 

> 
> A return value of null does not necessarily indicate that the map contains no mapping for the key; it's also possible that the map
>  explicitly maps the key to null. The `containsKey` operation may be used
>  to distinguish these two cases.
> 
> 
> 

**I am wondering if someone knows how I could use containsKey() in this way?**