Producer Consumer Problem in Java