private static int countStraights(int length, Card... hand) {

        int count = 0;

        Map<Integer, Integer> multiplier = new HashMap<>();
        List<Card> cards = new ArrayList<>();

        int value = -1;
        for (Card card : hand) {
            if (card.getStraightValue() == value) {
                if (!multiplier.containsKey(value)) {
                    multiplier.put(value, 2);
                } else {
                    multiplier.put(value, multiplier.get(value) + 1);
                }
            } else {
                if (card.getStraightValue() != value + 1) {
                    if (cards.size() == length) {
                        int c = 1;
                        for (int m : multiplier.values()) {
                            c *= m;
                        }
                        count += c;
                    }
                    multiplier.clear();
                    cards.clear();
                }
                cards.add(card);
            }
            value = card.getStraightValue();
        }
        if (cards.size() == length) {
            int c = 1;
            for (int m : multiplier.values()) {
                c *= m;
            }
            count += c;
        }
        return count;
    }