code: def test_filter_duplicate_messages(
      self, duplicate_filter_logger, caplog
  ):
      log = duplicate_filter_logger
      log.error("test error message")
      log.error("test error message")
      log.error("test error message")
      log.error("another error message")
      log.error("another error message")
      log.error("yet another error message")
  
      assert len(caplog.records) == 5
      assert caplog.records[0].msg == "test error message"
      assert caplog.records[1].msg == "(suppressed 2 repeated lines)"
      assert caplog.records[2].msg == "another error message"
      assert caplog.records[3].msg == "(suppressed 1 repeated lines)"
      assert caplog.records[4].msg == "yet another error message"
  
imports: from __future__ import annotations
  import logging
  import secrets
  import subprocess
  from decimal import Decimal
  from unittest.mock import patch
  import pikepdf
  import pytest
  from PIL import Image, UnidentifiedImageError
  from ocrmypdf._exec.ghostscript import DuplicateFilter, rasterize_pdf
  from ocrmypdf.exceptions import ColorConversionNeededError, ExitCode
  from ocrmypdf.helpers import Resolution
  from .conftest import check_ocrmypdf, run_ocrmypdf_api
label_desc: Use image node_id 2 for calling the TestDuplicateFilter obj's underlying member method code with example usage: obj.test_filter_duplicate_messages(duplicate_filter_logger, caplog) without return types