This is a Linked Queue impl. So size may be expensive... What about to use isEmpty() ? You can log the size afer you copied them to the ArrayList