Some codes while reading through the Concurrency Cookbook in Java 7