Testing Thread Contention in Java