// Populate a list of Comparators
final List<Comparator> comparatorsList;
if(foreignComparator == null) {
comparatorsList = Collections.EMPTY_LIST;
} else if(foreignComparator instanceof ComparatorChain) {
ComparatorChain chain = (ComparatorChain)foreignComparator;
comparatorsList = Arrays.asList(chain.getComparators());
} else {
comparatorsList = Collections.singletonList(foreignComparator);
}
// walk through the list of Comparators and assign click counts