def METHOD_NAME(expected):
    # set `is_set` for headers to False
    # because previously the headers have been set already
    TEST_WRITER.stream_info[TEST_STREAM]["is_set"] = False
    # writing duplicates
    for record in input_dup_records:
        stream_name = record["stream"]
        data = record["data"]
        TEST_WRITER.add_to_buffer(stream_name, data)
        TEST_WRITER.queue_write_operation(stream_name)
    # removing duplicates
    for configured_stream in TEST_CATALOG.streams:
        TEST_WRITER.deduplicate_records(configured_stream)
    # checking result
    test_wks = TEST_SPREADSHEET.open_worksheet(TEST_STREAM)
    records = test_wks.get_all_records()
    assert records == expected
    # remove the test worksheet after tests
    TEST_SPREADSHEET.spreadsheet.del_worksheet(test_wks)