Shared code for TestCounter fold