As far as I know, special bookkeeping does not exist - this means that the choice is made "randomly."
So says javadoc :
If any threads are waiting on this object, one of them is selected for awakening. The choice is arbitrary and is at the discretion of the implementation.
Thus, it is theoretically possible that the JVM implementation decides to accept a specific order; but, as shown, by default you cannot expect any order. Thus, you should not write code that also relies on such a specific order.
source share