def count_common_terms(list1, list2):
    """ Returns the number of common terms in two lists of terms.
    """
    if list1 is None or list2 is None:
        return 0
    return len(set(list1) & set(list2))