Delegates to Collection#remove. Returns false if the remove method throws a ClassCastException or NullPointerException.
(Collection<?> collection, @Nullable Object object)
| 120 | */ |
| 121 | |
| 122 | static boolean safeRemove(Collection<?> collection, @Nullable Object object) { |
| 123 | checkNotNull(collection); |
| 124 | try { |
| 125 | return collection.remove(object); |
| 126 | } catch (ClassCastException e) { |
| 127 | return false; |
| 128 | } catch (NullPointerException e) { |
| 129 | return false; |
| 130 | } |
| 131 | } |
| 132 | |
| 133 | static class FilteredCollection<E> extends AbstractCollection<E> { |
| 134 | final Collection<E> unfiltered; |
no test coverage detected