(Collection<?> c)
| 4124 | } |
| 4125 | |
| 4126 | @Override |
| 4127 | public boolean retainAll(Collection<?> c) { |
| 4128 | try { |
| 4129 | return super.retainAll(checkNotNull(c)); |
| 4130 | } catch (UnsupportedOperationException e) { |
| 4131 | Set<K> toRetain = new HashSet<>(); |
| 4132 | for (Entry<K, V> entry : map().entrySet()) { |
| 4133 | if (c.contains(entry.getValue())) { |
| 4134 | toRetain.add(entry.getKey()); |
| 4135 | } |
| 4136 | } |
| 4137 | return map().keySet().retainAll(toRetain); |
| 4138 | } |
| 4139 | } |
| 4140 | |
| 4141 | @Override |
| 4142 | public int size() { |