Implemented TimeToNextMove in Java.