Working Java Example for FIFO Queues