def equals(cls, lits, bound=1, top_id=None, encoding=EncType.seqcounter):
        """
            This method can be used for creating a CNF encoding of an EqualsK
            constraint, i.e. of :math:`\sum_{i=1}^{n}{x_i}= k`. The method
            makes consecutive calls of both :meth:`CardEnc.atleast` and
            :meth:`CardEnc.atmost`. It shares the arguments and the return type
            with method :meth:`CardEnc.atleast`. Please, see it for details.
        """

        res1 = cls.atleast(lits, bound, top_id, encoding)
        res2 = cls.atmost(lits, bound, res1.nv, encoding)

        # merging together AtLeast and AtMost constraints
        res1.nv = res2.nv
        res1.clauses.extend(res2.clauses)
        res1.atmosts.extend(res2.atmosts)

        return res1