Queue implementation using Java for sake of coding practice