// get cards from top
Cards cards = new CardsImpl();
int count = Math.min(controller.getLibrary().size(), 5);
if (count > 0) {
cards.addAll(controller.getLibrary().getTopCards(game, count));
controller.lookAtCards(sourceObject.getLogName(), cards, game);
// pick cards going to graveyard
TargetCard target = new TargetCard(0,5, Zone.LIBRARY, new FilterCard("cards to put into your graveyard"));
if (controller.choose(Outcome.Detriment, cards, target, game)) {
for (UUID cardId : (List<UUID>)target.getTargets()) {
Card card = cards.get(cardId, game);