<div dir="auto"><div>Alberto,</div><div dir="auto"><br></div><div dir="auto">I believe your getOrPut methods already exist as putIfAbsent and computeIfAbsent, unless I'm missing a subtle difference.<br><br><div class="gmail_quote gmail_quote_container" dir="auto"><div dir="ltr" class="gmail_attr">On Thu, Oct 16, 2025, 14:20 Alberto Otero Rodríguez <<a href="mailto:alber84ou@gmail.com">alber84ou@gmail.com</a>> wrote:</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>Also, other two new methods might be interesting if you want to get a value from a map, but if the key doesn't exist you want to insert that value in the map and return it:</div><div><br></div><div><div style="margin-left:40px">default V getOrPut(Object key, V defaultValue)</div><br></div><div style="margin-left:40px">
default V getOrPut(Object key,  Function<? super K, ? extends V> defaultValueFunction)</div></div></blockquote></div></div><div dir="auto"><br></div><div dir="auto">Chris</div><div dir="auto"><div class="gmail_quote gmail_quote_container" dir="auto"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
</blockquote></div></div></div>