public static void check(Deck deck) throws InvalidDeckException {
        if (deck.amounts.size() != deck.names.size()) {
            throw new InvalidDeckException("Number of amounts and names differ");
        }
        
        int total = 0;
        for (int i = 0; i < deck.amounts.size(); i++) {
            if (deck.amounts.get(i) > 4 && !Card.isBasicLand(deck.names.get(i))) {
                throw new InvalidDeckException("More than 4 instances of \""
                        + deck.names.get(i) + "\"");
            } else if (deck.amounts.get(i) < 0) {
                throw new InvalidDeckException("Negative number of instances "
                        + "of \"" + deck.names.get(i) + "\"");
            }
            total += deck.amounts.get(i);
        }
        
        if (total < 60) {
            throw new InvalidDeckException("Less than 60 cards in deck");
        }
    }