class DateExtractionHelper {

    public static int countDates(ExtractedDate date, List<? extends ExtractedDate> dates, DateExactness exactness) {
        int count = 0;
        for (ExtractedDate currentDate : dates) {
            if (date.equals(currentDate)) {
                continue;
            }
            DateExactness thisExactness = exactness;
            if (exactness == DateExactness.UNSET) {
                thisExactness = DateExactness.getCommonExactness(date.getExactness(), currentDate.getExactness());
            }
            DateComparator dc = new DateComparator(thisExactness);
            if (dc.compare(date, currentDate) == 0) {
                count++;
            }
        }
        return count;
    }

    private  DateExtractionHelper();

}