@SuppressWarnings({ "rawtypes", "unchecked" })
    @Override
    public boolean isChoiceBetween(Class pageTemplateModelElementClass) {
        List firstNonEmpty=null;
        for (List<PageElement> value : alternatives) {
            if (pageTemplateModelElementClass.isAssignableFrom(value.getClass())) return true;
            if (value instanceof List) {
                List listValue=(List)value;
                if (listValue.size()>0)
                    firstNonEmpty=listValue;
            }
        }
        if (firstNonEmpty==null) return false;
        return (pageTemplateModelElementClass.isAssignableFrom(firstNonEmpty.get(0).getClass()));
    }
Answers true if this is either a choice between the given class, or between Lists of the given class
container-search/src/main/java/com/yahoo/search/pagetemplates/model/Choice.java