Runs ifPresent with this map's value at key cast to T, only when key is present and its value is actually an instance of T — a value present under the wrong type is silently skipped rather than throwing a ClassCastException.
ClassCastException