question: public synchronized void addSubscription ( Subscription subscription ) { if ( waitList . isEmpty ( ) && ! serviceQueue . isEmpty ( ) ) { subscription . onPublish ( serviceQueue . poll ( ) ) ; } else { waitList . putIfAbsent ( subscription . getId ( ) , new WaitingSubscription ( subscription ) ) ; } }
target:  Add a subscription to the wait list. <p> A subscription should be added to the wait list when either: <p> a) The previous Publish response indicated that there were still more Notifications ready to be transferred and there were no more Publish requests queued to transfer them. <p> b) The publishing timer of a Subscription expired and there were either Notifications to be sent or a keep-alive Message to be sent.