@Override
    public int check(DiceSet diceSet) {
        int points = 0;
        Map<Integer, Integer> vals = new HashMap<Integer, Integer>();
        for (int i = 0; i < diceSet.SIZE; ++i) {
            int key = diceSet.getValue(i);

            if (!vals.containsKey(key)) {
                vals.put(key, 1);
            }
            else {
                vals.put(key, vals.get(key) + 1);
            }
        }

        for (Integer key: vals.keySet()) {
            if (vals.get(key) >= n) {
                for (int i = 0; i < diceSet.SIZE; ++i) {
                    points += diceSet.getValue(i);
                }
                break;
            }
        }
        return points;
    }