for (Combination repeatedComb: fourOfKinds)
repeatedCards.add(repeatedComb.getMaxValue());
allStraightCardLists = new ArrayList<Set<Card>>();
Set<Card> allNonRepCards = new TreeSet<Card>(new CardComparator());
CardFace previousCard = null;
for (Card card: allCards){
if (card.getFace().equals(previousCard))
continue;
else
previousCard = card.getFace();
allNonRepCards.add(card);
}
int i = 0;
int count = 0;
int previous = 100;
int position = -1;
List<Integer> positions = new ArrayList<Integer>();
do{
i = 0;
for (Card card: allNonRepCards){
i++;
if (position >= i ) continue;
if (card.getFace().getSerialNumber() == previous - 1){
previous--;
count++;
}
else{
previous = card.getFace().getSerialNumber();
position = i;
count = 1;
}
if (count == numCards){
positions.add(position);
break;
}
}
}while(count == numCards);
for (Integer pos: positions){
i = 0;
straightCardList = new TreeSet<Card>(new CardComparator());
for (Card card: allNonRepCards){
if (++i < pos) continue;
if (card.getFace().equals(CardFace.ACE) && numCards == 4){
straightCardList = null;
break;