class ArrayRefBlockGraph extends BlockGraph {
  /**
   * <p>
   * Constructs an {@link ArrayRefBlockGraph} from the given {@link Body}.
   * </p>
   *
   * <p>
   * Note that this constructor builds a {@link BriefUnitGraph} internally when splitting <tt>body</tt>'s {@link Unit}s into
   * {@link Block}s. Callers who need both a {@link BriefUnitGraph} and an {@link ArrayRefBlockGraph} should use the
   * constructor taking the <tt>BriefUnitGraph</tt> as a parameter, as a minor optimization.
   * </p>
   *
   * @param body
   *          the Body instance from which the graph is built.
   */
  public ArrayRefBlockGraph(Body body) {
    this(new BriefUnitGraph(body));
  }

  /**
   * Constructs an <tt>ArrayRefBlockGraph</tt> corresponding to the <tt>Unit</tt>-level control flow represented by the
   * passed {@link BriefUnitGraph}.
   *
   * @param unitGraph
   *          The <tt>BriefUnitGraph</tt> for which to build an <tt>ArrayRefBlockGraph</tt>.
   */
  public ArrayRefBlockGraph(BriefUnitGraph unitGraph) {
    super(unitGraph);

    soot.util.PhaseDumper.v().dumpGraph(this, mBody);
  }

  /**
   * <p>
   * Utility method for computing the basic block leaders for a {@link Body}, given its {@link UnitGraph} (i.e., the
   * instructions which begin new basic blocks).
   * </p>
   *
   * <p>
   * This implementation chooses as block leaders all the <tt>Unit</tt>s that {@link BlockGraph.computerLeaders()}, and adds:
   *
   * <ul>
   *
   * <li>All <tt>Unit</tt>s which contain an array reference, as defined by {@link Stmt.containsArrayRef()} and
   * {@link Inst.containsArrayRef()}.
   *
   * <li>The first <tt>Unit</tt> not covered by each {@link Trap} (i.e., the <tt>Unit</tt> returned by
   * {@link Trap.getLastUnit()}.</li>
   *
   * </ul>
   * </p>
   *
   * @param unitGraph
   *          is the <tt>Unit</tt>-level CFG which is to be split into basic blocks.
   *
   * @return the {@link Set} of {@link Unit}s in <tt>unitGraph</tt> which are block leaders.
   */
  @Override
  protected Set<Unit> computeLeaders(UnitGraph unitGraph) {<FILL_FUNCTION_BODY>}
}

    Body body = unitGraph.getBody();
    if (body != mBody) {
      throw new RuntimeException(
          "ArrayRefBlockGraph.computeLeaders() called with a UnitGraph that doesn't match its mBody.");
    }
    Set<Unit> leaders = super.computeLeaders(unitGraph);

    for (Unit unit : body.getUnits()) {
      if (((unit instanceof Stmt) && ((Stmt) unit).containsArrayRef())
          || ((unit instanceof Inst) && ((Inst) unit).containsArrayRef())) {
        leaders.add(unit);
      }
    }
    return leaders;
  
<methods>public List<soot.toolkits.graph.Block> getBlocks() ,public soot.Body getBody() ,public List<soot.toolkits.graph.Block> getHeads() ,public List<soot.toolkits.graph.Block> getPredsOf(soot.toolkits.graph.Block) ,public List<soot.toolkits.graph.Block> getSuccsOf(soot.toolkits.graph.Block) ,public List<soot.toolkits.graph.Block> getTails() ,public Iterator<soot.toolkits.graph.Block> iterator() ,public int size() ,public java.lang.String toString() <variables>protected List<soot.toolkits.graph.Block> mBlocks,protected soot.Body mBody,protected List<soot.toolkits.graph.Block> mHeads,protected List<soot.toolkits.graph.Block> mTails,protected Chain<soot.Unit> mUnits