Java Homework for Concurrent Programming course