Java tutorial
import java.util.concurrent.ArrayBlockingQueue; import java.util.concurrent.BlockingQueue; public class Main { public static void main(String[] argv) throws Exception { int capacity = 100; ArrayBlockingQueue<Integer> queue = new ArrayBlockingQueue<Integer>(capacity); for (int i = 0; i < 100; i++) { queue.add(i); } System.out.println(queue.contains(5)); queue.clear(); System.out.println(queue.contains(5)); } }