title: BlockingQueue how to wait until the Queue becomes non empty
body: <p>Im implimenting a java game with multiplayer and i have a sender thread to send a messages from a Queue  to another player.
  I have read here:
  <a href="https://developer.android.com/reference/java/util/concurrent/BlockingQueue.html" rel="nofollow">https://developer.android.com/reference/java/util/concurrent/BlockingQueue.html</a>
  "A Queue that additionally supports operations that wait for the queue to become non-empty"</p>
  
  <p>which operetions and how to use them , and i know that an infinte loop that always checks if something Queue is what i want to avoid.</p>