private void notificationRemoved(Notification removed){
  int offset=0;
  Iterator<Notification> it=displayed.iterator();
  while (it.hasNext()) {
    Notification n=it.next();
    if (removed == n) {
      offset=n.getHeight() + VERTICAL_MARGIN;
      it.remove();
    }
 else     if (offset > 0) {
      n.moveVertical(verticalMoveDirection * offset);
    }
  }
  Iterator<Notification> itQueue=queue.iterator();
  while (itQueue.hasNext() && displayed.size() < maxItems) {
    Notification next=itQueue.next();
    itQueue.remove();
    showNotification(next);
  }
}

private void notificationRemoved ( Notification removed ) { int offset = 0 ; Iterator < Notification > it = displayed . iterator ( ) ; while ( it . hasNext ( ) ) { Notification n = it . next ( ) ; if ( removed == n ) { offset = n . getHeight ( ) + VERTICAL_MARGIN ; it . remove ( ) ; } else if ( offset > 0 ) { n . moveVertical ( verticalMoveDirection * offset ) ; } } Iterator < Notification > itQueue = queue . iterator ( ) ; while ( itQueue . hasNext ( ) && displayed . size ( ) < maxItems ) { Notification next = itQueue . next ( ) ; itQueue . remove ( ) ; showNotification ( next ) ; } }
a notification was removed , reposition any other ones if necessary and remove it from the displayed - list .
