Understanding Queue Collection in Java with real life example