private Collection<String> emptyCollectionIfNull(Collection<String> collection) {
        return collection == null ? List.of() : collection;
    }
Given a search list which is a mixture of document types and cluster
names, and a restrict list which is a list of document types, return a
set of all valid document types for this combination. Most use-cases for
fetching index settings will involve calling this method with the the
incoming query's {@link com.yahoo.search.query.Model#getSources()} and
{@link com.yahoo.search.query.Model#getRestrict()} as input parameters
before calling any other method of this class.

@param sources the search list for a query
@param restrict the restrict list for a query
@return a (possibly empty) set of valid document types
container-search/src/main/java/com/yahoo/prelude/IndexFacts.java