可以使用 getOrDefault 方法。如果 Key 存在但 Value 为 Null,getOrDefault 方法会返回 defaultValue 的值。例如:

Map<String, String> map = new HashMap<>();
map.put('key', null);
String value = map.getOrDefault('key', 'default');
System.out.println(value); // 输出'default'