item's key
the priority to update for the existing item or to assign to the new item
will be assigned to true if the item already existed and wasn't created
flags whether not finding the item should count as a cache miss
The existing or created item or null if no item was found or created.
Out: if the item existed then the pointer is not null
Updates the priority of an item if it already existed or creates a new item with the given priority if it didn't exist.
Beware that in case an item didn't exist it is still possible that a new item will NOT be created if whenNewAndLeastPriority() implementation prefers the already existing item over the new one. The default implementation of whenNewAndLeastPriority() always creates a new one.