Using java to implement the classic concurrency or threading pattern.