I'd recommend that the exception thrown should be an IllegalStateException. This is documented in ConcurrentHashMap's computeIfAbsent as,
* @throws IllegalStateException if the computation detectably * attempts a recursive update to this map that would * otherwise never complete The detection logic is in Doug's repository to be merged in for JDK-8062841. It is also unexpected to have a concurrent data structure throw a ConcurrentModificationException, which is why I believe that IllegalStateException was chosen for ConcurrentHashMap.