code: @Override
    public int removeAll(KType e1) {
      int to = 0;
      for (int from = 0; from < elementsCount; from++) {
        if (Intrinsics.equals(this, e1, buffer[from])) {
          buffer[from] = Intrinsics.empty();
          continue;
        }
  
        if (to != from) {
          buffer[to] = buffer[from];
          buffer[from] = Intrinsics.empty();
        }
        to++;
      }
  
      final int deleted = elementsCount - to;
      this.elementsCount = to;
      return deleted;
    }
docs: {@inheritDoc}