(@Nullable Object element, int occurrences)
| 276 | } |
| 277 | |
| 278 | @CanIgnoreReturnValue |
| 279 | @Override |
| 280 | public int remove(@Nullable Object element, int occurrences) { |
| 281 | checkNonnegative(occurrences, "occurrences"); |
| 282 | if (occurrences == 0) { |
| 283 | return count(element); |
| 284 | } |
| 285 | AvlNode<E> root = rootReference.get(); |
| 286 | int[] result = new int[1]; // used as a mutable int reference to hold result |
| 287 | AvlNode<E> newRoot; |
| 288 | try { |
| 289 | @SuppressWarnings("unchecked") |
| 290 | E e = (E) element; |
| 291 | if (!range.contains(e) || root == null) { |
| 292 | return 0; |
| 293 | } |
| 294 | newRoot = root.remove(comparator(), e, occurrences, result); |
| 295 | } catch (ClassCastException e) { |
| 296 | return 0; |
| 297 | } catch (NullPointerException e) { |
| 298 | return 0; |
| 299 | } |
| 300 | rootReference.checkAndSet(root, newRoot); |
| 301 | return result[0]; |
| 302 | } |
| 303 | |
| 304 | @CanIgnoreReturnValue |
| 305 | @Override |
nothing calls this directly
no test coverage detected