}
while (cards.size() > 1) {
target = new TargetCard(1, Zone.LIBRARY, new FilterCard("card to put on top of library (last put is first drawn)"));
player.choose(Outcome.Benefit, cards, target, game);
Card card = cards.get(target.getFirstTarget(), game);
player.moveCardToLibraryWithInfo(card, source.getSourceId(), game, Zone.LIBRARY, true, false);
cards.remove(card);
}
if (cards.size() == 1) {
Card card = cards.get(cards.iterator().next(), game);
if (card != null) {