Java Producer-Consumer Problem