class CompositeDateTimeDecider implements Decider {

    @Override
    public List<Pair<PotentialColumn, Integer>> calculateConfidence(List<PotentialColumn> potentials,
            List<? extends List<? extends String>> sampleData)
    {
        List<Pair<PotentialColumn, Integer>> dateScores = myDateDecider.calculateConfidence(potentials, sampleData);

        Set<Integer> dateColumns = New.set();
        for (Pair<PotentialColumn, Integer> pair : dateScores)
        {
            dateColumns.add(Integer.valueOf(pair.getFirstObject().getColumnIndex()));
        }

        List<PotentialColumn> timePotentials = New.list();
        for (PotentialColumn column : potentials)
        {
            if (!dateColumns.contains(Integer.valueOf(column.getColumnIndex())))
            {
                timePotentials.add(column);
            }
        }

        List<Pair<PotentialColumn, Integer>> timeScores = myTimeDecider.calculateConfidence(timePotentials, sampleData);

        Pair<PotentialColumn, Integer> bestDate = getBestPassingColumn(dateScores);

        List<Pair<PotentialColumn, Integer>> bestColumns = New.list();

        if (bestDate != null)
        {
            Pair<PotentialColumn, Integer> bestTime = getBestPassingColumn(timeScores);

            if (bestTime != null && bestTime.getFirstObject().getColumnIndex() > bestDate.getFirstObject().getColumnIndex())
            {
                bestColumns.add(bestDate);
                bestColumns.add(bestTime);
            }
        }

        return bestColumns;
    }

}