android/guava/src/com/google/common/collect/Maps.java
static <V> V safeRemove(Map<?, V> map, Object key) {
    checkNotNull(map);
    try {
      return map.remove(key);
    } catch (ClassCastException | NullPointerException e) {
      return null;
    }
  }
static <V> V safeRemove(Map<?, V> map, Object key) {
    checkNotNull(map);
    try {
      return map.remove(key);
    } catch (ClassCastException | NullPointerException e) {
      return null;
    }
  }
Delegates to {@link Map#remove}. Returns {@code null} on {@code ClassCastException} and {@code
NullPointerException}.