Various concurrency examples in java