Removes
all of this collection's elements that are also contained in the specified collection. After
this call returns, this collection will contain no elements in common with the specified collection.

package com.logicbig.example.arrayblockingqueue;
import java.util.Arrays;
import java.util.concurrent.ArrayBlockingQueue;
public class RemoveAllExample {
public static void main(String... args) {
ArrayBlockingQueue<Integer> q = new ArrayBlockingQueue<>(3, true, Arrays.asList(1, 3, 5));
System.out.println("queue before: " + q);
boolean b = q.removeAll(Arrays.asList(1, 5, 7));
System.out.println(b);
System.out.println("queue after: " + q);
}
}
Output
queue before: [1, 3, 5]
true
queue after: [3]