// Add an entry with the key "key" cache.put("key", "value"); // And replace it if missing cache.putIfAbsent("key", "newValue"); // Validate that the new value was not added