Better use for (;;) and then call deque.poll() and check for null and if null break