Buggy code:
protected boolean canPlay ( ActivatedAbility ability , ManaOptions available , MageObject sourceObject , Game game ) { } protected boolean canPlayCardByAlternateCost ( Card sourceObject , ManaOptions available , Ability ability , Game game ) { } protected boolean canLandPlayAlternateSourceCostsAbility ( Card sourceObject , ManaOptions available , Ability ability , Game game ) { } @ Override public List < Ability > getPlayable ( Game game , boolean hidden ) { } @ Override public Set < UUID > getPlayableInHand ( Game game ) { } private boolean shouldSkipGettingPlayable ( Game game ) { } @ Override public List < Ability > getPlayableOptions ( Ability ability , Game game ) { } private void addModeOptions ( List < Ability > options , Ability option , Game game ) { } protected void addVariableXOptions ( List < Ability > options , Ability option , int targetNum , Game game ) { } protected void addTargetOptions ( List < Ability > options , Ability option , int targetNum , Game game ) { } private void addChoiceOptions ( List < Ability > options , Ability option , int choiceNum , Game game ) { } private void addCostTargetOptions ( List < Ability > options , Ability option , int targetNum , Game game ) { } @ Override public boolean isTestMode ( ) { } @ Override public void setTestMode ( boolean value ) { } @ Override public boolean isTopCardRevealed ( ) { } @ Override public void setTopCardRevealed ( boolean topCardRevealed ) { } @ Override public UserData getUserData ( ) { } @ Override public void setUserData ( UserData userData ) { } @ Override public void addAction ( String action ) { } @ Override public int getActionCount ( ) { } @ Override public void setAllowBadMoves ( boolean allowBadMoves ) { } @ Override public boolean canPayLifeCost ( ) { } @ Override public void setCanPayLifeCost ( boolean canPayLifeCost ) { } @ Override public boolean canPaySacrificeCost ( ) { } @ Override public void setCanPaySacrificeCost ( boolean canPaySacrificeCost ) { } @ Override public boolean canLoseByZeroOrLessLife ( ) { } @ Override public void setLoseByZeroOrLessLife ( boolean loseByZeroOrLessLife ) { } @ Override public boolean canPlayCardsFromGraveyard ( ) { } @ Override public void setPlayCardsFromGraveyard ( boolean playCardsFromGraveyard ) { } @ Override public boolean autoLoseGame ( ) { } @ Override public void becomesActivePlayer ( ) { } @ Override public int getTurns ( ) { } @ Override public int getStoredBookmark ( ) { } @ Override public void setStoredBookmark ( int storedBookmark ) { } @ Override public synchronized void resetStoredBookmark ( Game game ) { } @ Override public void revealFaceDownCard ( Card card , Game game ) { } @ Override public void setPriorityTimeLeft ( int timeLeft ) { } @ Override public int getPriorityTimeLeft ( ) { } @ Override public boolean hasQuit ( ) { } @ Override public boolean hasTimerTimeout ( ) { } @ Override public boolean hasIdleTimeout ( ) { } @ Override public void setReachedNextTurnAfterLeaving ( boolean reachedNextTurnAfterLeaving ) { } @ Override public boolean hasReachedNextTurnAfterLeaving ( ) { } @ Override public boolean canJoinTable ( Table table ) { } @ Override public void setCommanderId ( UUID commanderId ) { } @ Override public UUID getCommanderId ( ) { } @ Override public boolean moveCardToHandWithInfo ( Card card , UUID sourceId , Game game , Zone fromZone ) { } @ Override public boolean moveCardsToGraveyardWithInfo ( Cards allCards , Ability source , Game game , Zone fromZone ) { } @ Override public boolean moveCardsToGraveyardWithInfo ( List < Card > allCards , Ability source , Game game , Zone fromZone ) { while ( ! ( allCards . isEmpty ( ) ) ) { Cards cards = new CardsImpl ( ) ; UUID ownerId = null ; for ( Card card : allCards ) { if ( cards . isEmpty ( ) ) { ownerId = card . getOwnerId ( ) ; } if ( card . getOwnerId ( ) . equals ( ownerId ) ) { cards . add ( card ) ; } } <START_BUG> allCards . removeAll ( cards ) ; <END_BUG> if ( ( cards . size ( ) ) != 0 ) { TargetCard target = new TargetCard ( fromZone , new FilterCard ( "card<seq2seq4repair_space>to<seq2seq4repair_space>put<seq2seq4repair_space>on<seq2seq4repair_space>the<seq2seq4repair_space>top<seq2seq4repair_space>of<seq2seq4repair_space>your<seq2seq4repair_space>graveyard<seq2seq4repair_space>(last<seq2seq4repair_space>one<seq2seq4repair_space>chosen<seq2seq4repair_space>will<seq2seq4repair_space>be<seq2seq4repair_space>topmost)" ) ) ; target . setRequired ( true ) ; Player choosingPlayer = this ; if ( ownerId != ( this . getId ( ) ) ) { choosingPlayer = game . getPlayer ( ownerId ) ; } if ( choosingPlayer == null ) { continue ; } boolean chooseOrder = true ; if ( ( cards . size ( ) ) > 2 ) { chooseOrder = choosingPlayer . chooseUse ( Neutral , "Do<seq2seq4repair_space>you<seq2seq4repair_space>like<seq2seq4repair_space>to<seq2seq4repair_space>choose<seq2seq4repair_space>the<seq2seq4repair_space>order<seq2seq4repair_space>the<seq2seq4repair_space>cards<seq2seq4repair_space>go<seq2seq4repair_space>to<seq2seq4repair_space>graveyard?" , game ) ; } if ( chooseOrder ) { while ( ( choosingPlayer . isInGame ( ) ) && ( ( cards . size ( ) ) > 1 ) ) { choosingPlayer . chooseTarget ( Neutral , cards , target , source , game ) ; UUID targetObjectId = target . getFirstTarget ( ) ; Card card = cards . get ( targetObjectId , game ) ; cards . remove ( targetObjectId ) ; if ( card != null ) { choosingPlayer . moveCardToGraveyardWithInfo ( card , source . getSourceId ( ) , game , fromZone ) ; } target . clearChosen ( ) ; } if ( ( cards . size ( ) ) == 1 ) { choosingPlayer . moveCardToGraveyardWithInfo ( cards . getCards ( game ) . iterator ( ) . next ( ) , source . getSourceId ( ) , game , fromZone ) ; } } else { for ( Card card : cards . getCards ( game ) ) { choosingPlayer . moveCardToGraveyardWithInfo ( card , source . getSourceId ( ) , game , fromZone ) ; } } } } return true ; }

Fix:
allCards . removeAll ( cards . getCards ( game ) ) ;