Producer-Consumer exercise for CS471 written in Java