Java implementation of a Dequeue and Randomized Queue