62 |
|
* Removes the entry for a key only if currently mapped to a given value. |
63 |
|
* This is equivalent to |
64 |
|
* <pre> {@code |
65 |
< |
* if (map.containsKey(key) && map.get(key).equals(value)) { |
65 |
> |
* if (map.containsKey(key) && Objects.equals(map.get(key), value)) { |
66 |
|
* map.remove(key); |
67 |
|
* return true; |
68 |
|
* } else |
88 |
|
* Replaces the entry for a key only if currently mapped to a given value. |
89 |
|
* This is equivalent to |
90 |
|
* <pre> {@code |
91 |
< |
* if (map.containsKey(key) && map.get(key).equals(oldValue)) { |
91 |
> |
* if (map.containsKey(key) && Objects.equals(map.get(key), oldValue)) { |
92 |
|
* map.put(key, newValue); |
93 |
|
* return true; |
94 |
|
* } else |