Issue #3128814 by longwave, jungle, dww: Replace assert* involving count() and an equality operator with assertCount() (cherry picked from commit 3ea981a1)