Periksa apakah entri di hashmap dihapus di java

Object removedObject = myMap.remove(1);
boolean wasRemoved = removedObject != null;
Shubhangi_Mishra