'Checks the difference between the given count vectors through a
given difference function.
:param cv1:                 List of counts to put in the first CV.
:param cv2:                 List of counts to put in the second CV.
:param expected_difference: The expected difference value.
:param diff_function:       The name of the member function to check
(string).'

def check_difference(self, cv1, cv2, expected_difference, diff_function):

    count_vector1 = CountVector('', conditions=[(lambda : False) for i in cv1])
    count_vector2 = CountVector('', conditions=[(lambda : False) for i in cv2])
    count_vector1.count_vector = cv1
    count_vector2.count_vector = cv2
    self.assertEqual(getattr(count_vector1, diff_function)(count_vector2), expected_difference, 'Difference    value    for    vectors    {}    and    {}    doesnt    match.'.format(cv1, cv2))
    self.assertEqual(getattr(count_vector2, diff_function)(count_vector1), expected_difference, 'The    difference    operation    is    not    symmetric.')
