public static CardList filterListByType(CardList list, String type, SpellAbility sa) {
        if (type == null)
            return list;

        // Filter List Can send a different Source card in for things like Mishra and Lobotomy

        Card source = sa.getSourceCard();
        if (type.contains("Triggered")) {
            Object o = sa.getTriggeringObject("Card");

            // I won't the card attached to the Triggering object
            if (!(o instanceof Card))
                return new CardList();

            source = (Card) (o);
            type = type.replace("Triggered", "Card");
        } else if (type.contains("Remembered")) {
            boolean hasRememberedCard = false;
            for (Object o : source.getRemembered()) {
                if (o instanceof Card) {
                    hasRememberedCard = true;
                    source = (Card) o;
                    type = type.replace("Remembered", "Card");
                    break;
                }
            }

            if (!hasRememberedCard)
                return new CardList();
        }

        return list.getValidCards(type.split(","), sa.getActivatingPlayer(), source);
    }