def METHOD_NAME(self, num, test=None):
    found = len([item for item in itertools.ifilter(test, self._contents)])
    assert num == found, \
        "Found [%d] lines, not [%d] in [%s]\n\nContents:\n%s" % \
        (found, num, self._path, "\n".join(self._contents))
    return self