private Hand getHand(List<Card> cards, List<Card> hand) {
        Collections.sort(cards);

        Hand h;
        if (isStraightFlush(cards, hand)) {
            h = Hand.STRAIGHTFLUSH;
        } else if (isFourOfAKind(cards, hand)) {
            h = Hand.FOUROFAKIND;
        } else if (isFullHouse(cards, hand)) {
            h = Hand.FULLHOUSE;
        } else if (isFlush(cards, hand)) {
            h = Hand.FLUSH;
        } else if (isStraight(cards, hand)) {
            h = Hand.STRAIGHT;
        } else if (isThreeOfAKind(cards, hand)) {
            h = Hand.THREEOFAKIND;
        } else if (isTwoPair(cards, hand)) {
            h = Hand.TWOPAIR;
        } else if (isPair(cards, hand)) {
            h = Hand.PAIR;
        } else {
            h = Hand.HIGHCARD;
        }

        return h;
    }