if(cost.pay(source, game, source.getSourceId(), source.getControllerId(), false)){
controller.putOntoBattlefieldWithInfo(card, game, Zone.LIBRARY, source.getSourceId());
}
else{
//If you don't, put it into its owner's graveyard. Then shuffle your library
controller.moveCardToGraveyardWithInfo(card, source.getSourceId(), game, Zone.LIBRARY);
}
}
}
}
}