If zero or one threads are waiting on the object, notify() and notifyAll() do the same. If more than one
thread is waiting, notify() only wakes up one of them, but notifyAll() wakes up all of them. You can't control which one is woken by notify().
In practice, notifyAll() is used much more often.