Demo of Java thread scheduling.