// Pick a random timeout point between [TIMEOUT_BASE, TIMEOUT_BASE + TIMEOUT_RANDOMNESS)
// nanoseconds from now.
final long end = start + TIMEOUT_BASE + (long) (Math.random() * TIMEOUT_RANDOMNESS);
final User user = (User) hSession.getAttribute(SessionAttribute.USER);
assert (user != null);
user.contactedServer();
while (!(user.hasQueuedMessages()) && System.nanoTime() - end < 0) {
try {
user.waitForNewMessageNotification(TimeUnit.NANOSECONDS.toMillis(end - System.nanoTime()));
} catch (final InterruptedException ie) {
// pass