protected function getValueChecker()
    {
        return function ($a, $b, ComparatorInterface $comparator) {

            $exceptionMessage = 'Comparator (%s) does not support "%s"';

            $error = null;
            if (!$comparator->supports($a)) {
                $error = sprintf($exceptionMessage, get_class($comparator), gettype($a));
            } elseif (!$comparator->supports($b)) {
                $error = sprintf($exceptionMessage, get_class($comparator), gettype($a));
            }

            if ($error !== null) {
                throw new \RuntimeException($error);
            }
        };
    }