I am tracking a list of colors. I only need to worry about the last two colors added to this list. So this queue should be a fixed size (of 2).
queue.add(color1);
queue.add(color2);
queue.add(color3); //adding color3 should automatically remove color1 from the queue.
//So the queue should now only contain 'color2' and 'color3'
Does Java have a built in Collection for this type of operation? Or do I need to build it myself?