code: @Override
  	public void addListener(InvalidationListener listener) {
  		Objects.requireNonNull(listener);
  		if (size == 0) {
  			sentinel = false;
  			invalidationSize = 1;
  			this.listener = listener;
  		} else if (size == 1) {
  			sentinel = false;
  			if (invalidationSize == 1) {
  				invalidationSize = 2;
  				this.listener = new Object[]{this.listener, listener};
  			} else {
  				invalidationSize = 1;
  				this.listener = new Object[]{listener, this.listener};
  			}
  		} else {
  			Object[] l = (Object[]) this.listener;
  
  			if (l.length <= size + 1 || sentinel) {
  				sentinel = false;
  				l = Arrays.copyOf(l, l.length * 3 / 2 + 1);
  				this.listener = l;
  			}
  			if (size > invalidationSize) {
  				System.arraycopy(l, invalidationSize, l, invalidationSize + 1, size - invalidationSize);
  			}
  			l[invalidationSize] = listener;
  			invalidationSize++;
  		}
  		size++;
  	}
docs: {@inheritDoc}