class SortedArraySet extends PointsToSetInternal {
  public SortedArraySet(Type type, PAG pag) {
    super(type);
    this.pag = pag;
  }

  /** Returns true if this set contains no run-time objects. */
  public final boolean isEmpty() {
    return size == 0;
  }

  /**
   * Adds contents of other into this set, returns true if this set changed.
   */
  public final boolean addAll(final PointsToSetInternal other, final PointsToSetInternal exclude) {
    boolean ret = false;
    BitVector typeMask = (pag.getTypeManager()).get(type);
    if (other instanceof SortedArraySet) {
      SortedArraySet o = (SortedArraySet) other;
      Node[] mya = nodes;
      Node[] oa = o.nodes;
      int osize = o.size;
      Node[] newa = new Node[size + osize];
      int myi = 0;
      int oi = 0;
      int newi = 0;
      for (;;) {
        if (myi < size) {
          if (oi < osize) {
            int myhc = mya[myi].getNumber();
            int ohc = oa[oi].getNumber();
            if (myhc < ohc) {
              newa[newi++] = mya[myi++];
            } else if (myhc > ohc) {
              if ((type == null || typeMask == null || typeMask.get(ohc))
                  && (exclude == null || !exclude.contains(oa[oi]))) {
                newa[newi++] = oa[oi];
                ret = true;
              }
              oi++;
            } else {
              newa[newi++] = mya[myi++];
              oi++;
            }
          } else { // oi >= osize
            newa[newi++] = mya[myi++];
          }
        } else { // myi >= size
          if (oi < osize) {
            int ohc = oa[oi].getNumber();
            if ((type == null || typeMask == null || typeMask.get(ohc)) && (exclude == null || !exclude.contains(oa[oi]))) {
              newa[newi++] = oa[oi];
              ret = true;
            }
            oi++;
          } else {
            break;
          }
        }
      }
      nodes = newa;
      size = newi;
      return ret;
    }
    return super.addAll(other, exclude);
  }

  /** Calls v's visit method on all nodes in this set. */
  public final boolean forall(P2SetVisitor v) {
    for (int i = 0; i < size; i++) {
      v.visit(nodes[i]);
    }
    return v.getReturnValue();
  }

  /** Adds n to this set, returns true if n was not already in this set. */
  public final boolean add(Node n) {<FILL_FUNCTION_BODY>}

  /** Returns true iff the set contains n. */
  public final boolean contains(Node n) {
    int left = 0;
    int right = size;
    int hc = n.getNumber();
    while (left < right) {
      int mid = (left + right) / 2;
      int midhc = nodes[mid].getNumber();
      if (midhc < hc) {
        left = mid + 1;
      } else if (midhc > hc) {
        right = mid;
      } else {
        return true;
      }
    }
    return false;
  }

  public final static P2SetFactory getFactory() {
    return new P2SetFactory() {
      public final PointsToSetInternal newSet(Type type, PAG pag) {
        return new SortedArraySet(type, pag);
      }
    };
  }

  /* End of public methods. */
  /* End of package methods. */

  private Node[] nodes = null;
  private int size = 0;
  private PAG pag = null;
}

    if (pag.getTypeManager().castNeverFails(n.getType(), type)) {
      if (contains(n)) {
        return false;
      }
      int left = 0;
      int right = size;
      int mid;
      int hc = n.getNumber();
      while (left < right) {
        mid = (left + right) / 2;
        int midhc = nodes[mid].getNumber();
        if (midhc < hc) {
          left = mid + 1;
        } else if (midhc > hc) {
          right = mid;
        } else {
          break;
        }
      }
      if (nodes == null) {
        nodes = new Node[size + 4];
      } else if (size == nodes.length) {
        Node[] newNodes = new Node[size + 4];
        System.arraycopy(nodes, 0, newNodes, 0, nodes.length);
        nodes = newNodes;
      }
      System.arraycopy(nodes, left, nodes, left + 1, size - left);
      nodes[left] = n;
      size++;
      return true;
    }
    return false;
  
<methods>public void <init>(soot.Type) ,public abstract boolean add(soot.jimple.spark.pag.Node) ,public boolean addAll(soot.jimple.spark.sets.PointsToSetInternal, soot.jimple.spark.sets.PointsToSetInternal) ,public abstract boolean contains(soot.jimple.spark.pag.Node) ,public void flushNew() ,public abstract boolean forall(soot.jimple.spark.sets.P2SetVisitor) ,public soot.jimple.spark.sets.PointsToSetInternal getNewSet() ,public soot.jimple.spark.sets.PointsToSetInternal getOldSet() ,public soot.Type getType() ,public boolean hasNonEmptyIntersection(soot.PointsToSet) ,public void mergeWith(soot.jimple.spark.sets.PointsToSetInternal) ,public boolean pointsToSetEquals(java.lang.Object) ,public int pointsToSetHashCode() ,public Set<soot.jimple.ClassConstant> possibleClassConstants() ,public Set<java.lang.String> possibleStringConstants() ,public Set<soot.Type> possibleTypes() ,public void setType(soot.Type) ,public int size() ,public java.lang.String toString() ,public void unFlushNew() <variables>private static final org.slf4j.Logger logger,protected soot.Type type