code: def test_SwapSpecialEnt(self):
      # test data with two type entities
      test_data = {
          "x": "Titanic Brilliant and moving performances "
          "by Tom Courtenay and Peter Finch",
          "y": "negative",
      }
      test_sample = SASample(test_data)
      for entity_type in ["person", "movie"]:
          test_trans = SwapSpecialEnt(entity_type=entity_type)
          self.assertTrue(
              len(test_trans.transform(test_sample, n=5)) == 5
          )
  
      # test data with no entity
      test_data = {
          "x": "Brilliant and moving performances by  and ",
          "y": "negative",
      }
      test_sample = SASample(test_data)
      self.assertEqual([], test_trans.transform(test_sample))
  
      test_trans = SwapSpecialEnt(entity_type="person")
      # test data with entity at the beginning of sentence
      test_data = {
          "x": "Peter Finch Brilliant and moving "
          "performances by and ",
          "y": "negative",
      }
      test_sample = SASample(test_data)
      trans_samples = test_trans.transform(test_sample)
      for mask_value in trans_samples[0].get_mask("x")[0:2]:
          self.assertEqual(mask_value, 2)
  
      # test data with entity at the end of sentence
      test_data = {
          "x": " Brilliant and moving performances "
          "by and Peter Finch",
          "y": "negative",
      }
      test_sample = SASample(test_data)
      trans_samples = test_trans.transform(test_sample)
      for mask_value in trans_samples[0].get_mask("x")[
          len(test_sample.get_words("x")) - 2 :
      ]:
          self.assertEqual(mask_value, 2)
  
imports: import unittest
  from textflint.input.component.sample.sa_sample import SASample
  from textflint.generation.transformation.SA.swap_special_ent import SwapSpecialEnt
label_desc: Use image node_id 3 for calling the TestSwapSpecialEnt obj's underlying member method code with example usage: obj.test_SwapSpecialEnt() without return types