class CompositeFileComparator extends AbstractFileComparator implements Serializable {

    public int compare(final File file1, final File file2) {
        int result = 0;
        for (final Comparator<File> delegate : delegates) {
            result = delegate.compare(file1, file2);
            if (result != 0) {
                break;
            }
        }
        return result;
    }

    @SuppressWarnings("unchecked") // casts 1 & 2 must be OK because types are already correct public  CompositeFileComparator(final Comparator<File>... delegates);
    @SuppressWarnings("unchecked") // casts 1 & 2 must be OK because types are already correct public  CompositeFileComparator(final Iterable<Comparator<File>> delegates);

}