Maximum Size List in Java
It's useful to me to have a data structure in Java that has all the functionality of a List, but has a maximum storage capacity, and drops older data when newer data is added. Conceivably at some point I might want to implement a fixed size Queue which keeps a more general ordering of the data, and drops the old data lowest in that ordering, but that's the for the future. At the moment I'm implementing it like this: public class FixedSizeList<T> { private final int maxSize; private final LinkedList<T> list = new LinkedList<T>(); public FixedSizeQueue(int maxSize) { this.maxSize = maxSize < 0 ?