class AbstractSwitchInst extends AbstractInst implements SwitchInst {

  UnitBox defaultTargetBox;
  UnitBox[] targetBoxes;
  List<UnitBox> unitBoxes;

  public AbstractSwitchInst(Unit defaultTarget, List<? extends Unit> targets) {
    this.defaultTargetBox = Baf.v().newInstBox(defaultTarget);

    // Build up 'targetBoxes'
    final int numTargets = targets.size();
    UnitBox[] tgts = new UnitBox[numTargets];
    for (int i = 0; i < numTargets; i++) {
      tgts[i] = Baf.v().newInstBox(targets.get(i));
    }
    this.targetBoxes = tgts;

    // Build up 'unitBoxes'
    List<UnitBox> unitBoxes = new ArrayList<UnitBox>(numTargets + 1);
    for (UnitBox element : tgts) {
      unitBoxes.add(element);
    }
    unitBoxes.add(defaultTargetBox);
    this.unitBoxes = Collections.unmodifiableList(unitBoxes);
  }

  @Override
  public int getInCount() {
    return 1;
  }

  @Override
  public int getInMachineCount() {
    return 1;
  }

  @Override
  public int getOutCount() {
    return 0;
  }

  @Override
  public int getOutMachineCount() {
    return 0;
  }

  @Override
  public List<UnitBox> getUnitBoxes() {
    return unitBoxes;
  }

  @Override
  public boolean fallsThrough() {
    return false;
  }

  @Override
  public boolean branches() {
    return true;
  }

  @Override
  public Unit getDefaultTarget() {
    return defaultTargetBox.getUnit();
  }

  @Override
  public void setDefaultTarget(Unit defaultTarget) {
    defaultTargetBox.setUnit(defaultTarget);
  }

  @Override
  public UnitBox getDefaultTargetBox() {
    return defaultTargetBox;
  }

  @Override
  public int getTargetCount() {
    return targetBoxes.length;
  }

  @Override
  public Unit getTarget(int index) {
    return targetBoxes[index].getUnit();
  }

  @Override
  public void setTarget(int index, Unit target) {
    targetBoxes[index].setUnit(target);
  }

  @Override
  public void setTargets(List<Unit> targets) {<FILL_FUNCTION_BODY>}

  @Override
  public UnitBox getTargetBox(int index) {
    return targetBoxes[index];
  }

  @Override
  public List<Unit> getTargets() {
    List<Unit> targets = new ArrayList<Unit>();
    for (UnitBox element : targetBoxes) {
      targets.add(element.getUnit());
    }
    return targets;
  }
}

    final UnitBox[] targetBoxes = this.targetBoxes;
    for (int i = 0; i < targets.size(); i++) {
      targetBoxes[i].setUnit(targets.get(i));
    }
  
<methods>public non-sealed void <init>() ,public boolean branches() ,public java.lang.Object clone() ,public boolean containsArrayRef() ,public boolean containsFieldRef() ,public boolean containsInvokeExpr() ,public boolean containsNewExpr() ,public boolean fallsThrough() ,public int getInCount() ,public int getInMachineCount() ,public abstract java.lang.String getName() ,public int getNetCount() ,public int getNetMachineCount() ,public int getOutCount() ,public int getOutMachineCount() ,public java.lang.String toString() ,public void toString(soot.UnitPrinter) <variables>