public static void sortBySelectable(CardList list, String type) {
        final String t = type;
        Comparator<Card> com = new Comparator<Card>() {
            public int compare(Card a, Card b) {
                if (a.isType(t)
                        && b.isType(t))
                    return 0;
                else if (a.hasKeyword(t))
                    return 1;
                else if (b.hasKeyword(t))
                    return -1;

                return 0;
            }
        };
        list.sort(com);
    }