return combinationList.size() == 0 ? null : combinationList;
}
public static List<Pair> analysePair(Set<Card> allCards, PlayingCards plCards){
Pair pair = null;
List<Pair> pairs = null;
int count = 0;
int i = 0;
CardFace cardFace = null;
for (Card card: allCards){
i++;
if (card.getFace().equals(cardFace))
count++;
else{
if (count == 2){
if (pairs == null) pairs = new ArrayList<Pair>();
pair = new Pair();
pair.setCombinationList(getListOfCardsByFace(allCards,cardFace));
pairs.add(pair);
}
cardFace = card.getFace();
count = 1;
}
}
if (count == 2){
if (pairs == null) pairs = new ArrayList<Pair>();
pair = new Pair();
pair.setCombinationList(getListOfCardsByFace(allCards,cardFace));
pairs.add(pair);
}
return pairs;
}