Program: 112720
Project: 112720
Buggy source:
/** 
 * Use the card on the given target <p> This is the core implementation of card's ability
 * @param side
 * @param boardState The BoardState before this card has performed its action. It will be manipulated and returned.
 * @return The boardState is manipulated and returned
 */
protected HearthTreeNode use_core(PlayerSide side,Minion targetMinion,HearthTreeNode boardState,boolean singleRealizationOnly) throws HSException {
  HearthTreeNode toRet=boardState;
  CardEffectCharacter effect=null;
  if (this instanceof CardEffectTargetableInterface) {
    effect=((CardEffectTargetableInterface)this).getTargetableEffect();
  }
  byte manaCost=this.getManaCost(PlayerSide.CURRENT_PLAYER,boardState.data_);
  if (this instanceof SpellRandomInterface) {
    int originIndex=boardState.data_.modelForSide(PlayerSide.CURRENT_PLAYER).getHand().indexOf(this);
    int targetIndex=boardState.data_.modelForSide(side).getIndexForCharacter(targetMinion);
    toRet=new RandomEffectNode(toRet,new HearthAction(HearthAction.Verb.USE_CARD,side,0,side,0));
    Collection<HearthTreeNode> children=((SpellRandomInterface)this).createChildren(PlayerSide.CURRENT_PLAYER,originIndex,toRet);
    for (    HearthTreeNode child : children) {
      if (effect != null) {
        child=effect.applyEffect(PlayerSide.CURRENT_PLAYER,null,side,targetIndex,child);
      }
      child.data_.modelForSide(PlayerSide.CURRENT_PLAYER).subtractMana(manaCost);
      toRet.addChild(child);
    }
  }
 else {
    boolean removeCard=true;
    if (this instanceof CardEffectAoeInterface) {
      toRet=this.effectAllUsingFilter(((CardEffectAoeInterface)this).getAoeEffect(),((CardEffectAoeInterface)this).getAoeFilter(),toRet);
    }
 else     if (this instanceof CardEffectRandomTargetInterface) {
      removeCard=false;
      CardEffectRandomTargetInterface that=(CardEffectRandomTargetInterface)this;
      toRet=new RandomEffectNode(toRet,new HearthAction(HearthAction.Verb.USE_CARD,side,0,side,0));
      Collection<HearthTreeNode> children=this.effectRandomCharacterUsingFilter(that.getRandomTargetEffect(),that.getRandomTargetFilter(),toRet);
switch (children.size()) {
case 0:
        toRet=null;
      break;
case 1:
    toRet=children.stream().findAny().get();
  break;
default :
for (HearthTreeNode child : children) {
  child.data_.modelForSide(PlayerSide.CURRENT_PLAYER).subtractMana(manaCost);
  this.notifyCardPlayResolve(child,singleRealizationOnly);
  toRet.addChild(child);
}
}
}
 else if (effect != null) {
toRet=effect.applyEffect(PlayerSide.CURRENT_PLAYER,this,side,targetMinion,toRet);
}
if (toRet != null) {
PlayerModel currentPlayer=toRet.data_.getCurrentPlayer();
currentPlayer.subtractMana(manaCost);
if (removeCard) {
currentPlayer.getHand().remove(this);
}
}
}
return toRet;
}

Fixed version (ground truth):
/** 
 * Use the card on the given target <p> This is the core implementation of card's ability
 * @param side
 * @param boardState The BoardState before this card has performed its action. It will be manipulated and returned.
 * @return The boardState is manipulated and returned
 */
protected HearthTreeNode use_core(PlayerSide side,Minion targetMinion,HearthTreeNode boardState,boolean singleRealizationOnly) throws HSException {
  HearthTreeNode toRet=boardState;
  int targetIndex=boardState.data_.modelForSide(side).getIndexForCharacter(targetMinion);
  CardEffectCharacter effect=null;
  if (this instanceof CardEffectTargetableInterface) {
    effect=((CardEffectTargetableInterface)this).getTargetableEffect();
  }
  byte manaCost=this.getManaCost(PlayerSide.CURRENT_PLAYER,boardState.data_);
  boolean doEffect=true;
  Collection<HearthTreeNode> rngChildren=null;
  if (this instanceof SpellRandomInterface) {
    int originIndex=boardState.data_.modelForSide(PlayerSide.CURRENT_PLAYER).getHand().indexOf(this);
    rngChildren=((SpellRandomInterface)this).createChildren(PlayerSide.CURRENT_PLAYER,originIndex,toRet);
  }
 else   if (this instanceof CardEffectRandomTargetInterface) {
    doEffect=false;
    CardEffectRandomTargetInterface that=(CardEffectRandomTargetInterface)this;
    rngChildren=this.effectRandomCharacterUsingFilter(that.getRandomTargetEffect(),that.getRandomTargetFilter(),toRet);
  }
 else   if (this instanceof CardEffectAoeInterface) {
    doEffect=false;
    toRet=this.effectAllUsingFilter(((CardEffectAoeInterface)this).getAoeEffect(),((CardEffectAoeInterface)this).getAoeFilter(),toRet);
  }
  if (toRet == null) {
    return null;
  }
  if (rngChildren != null) {
    toRet=new RandomEffectNode(toRet,new HearthAction(HearthAction.Verb.USE_CARD,side,0,side,0));
switch (rngChildren.size()) {
case 0:
      toRet=null;
    break;
case 1:
  toRet=rngChildren.stream().findAny().get();
toRet.data_.modelForSide(PlayerSide.CURRENT_PLAYER).subtractMana(manaCost);
if (doEffect && effect != null) {
toRet=effect.applyEffect(PlayerSide.CURRENT_PLAYER,null,side,targetIndex,toRet);
}
break;
default :
toRet=new RandomEffectNode(toRet,new HearthAction(HearthAction.Verb.USE_CARD,side,0,side,0));
for (HearthTreeNode child : rngChildren) {
if (doEffect && effect != null) {
child=effect.applyEffect(PlayerSide.CURRENT_PLAYER,null,side,targetIndex,child);
}
child.data_.modelForSide(PlayerSide.CURRENT_PLAYER).subtractMana(manaCost);
toRet.addChild(child);
}
}
}
 else {
if (doEffect && effect != null) {
toRet=effect.applyEffect(PlayerSide.CURRENT_PLAYER,this,side,targetMinion,toRet);
}
if (toRet != null) {
PlayerModel currentPlayer=toRet.data_.getCurrentPlayer();
toRet.data_.modelForSide(PlayerSide.CURRENT_PLAYER).subtractMana(manaCost);
currentPlayer.getHand().remove(this);
}
}
return toRet;
}