Map<String, Object> map = new HashMap<>();
for (Map.Entry<String, Object> entry: map.entrySet()) {
String key = entry.getKey();
if (key.equals("message")) {
//some code
} else {
//some code
}