Testing, masking, and herd immunity