A simulation of a CPU scheduling algorithm in Java