code: def testIntersect(self):
      mask1 = field_mask_pb2.FieldMask()
      mask2 = field_mask_pb2.FieldMask()
      out_mask = field_mask_pb2.FieldMask()
      # Test cases without overlapping.
      mask1.FromJsonString("foo,baz")
      mask2.FromJsonString("bar,quz")
      out_mask.Intersect(mask1, mask2)
      self.assertEqual("", out_mask.ToJsonString())
      # Overlap with duplicated paths.
      mask1.FromJsonString("foo,baz.bb")
      mask2.FromJsonString("baz.bb,quz")
      out_mask.Intersect(mask1, mask2)
      self.assertEqual("baz.bb", out_mask.ToJsonString())
      # Overlap with paths covering some other paths.
      mask1.FromJsonString("foo.bar.baz,quz")
      mask2.FromJsonString("foo.bar,bar")
      out_mask.Intersect(mask1, mask2)
      self.assertEqual("foo.bar.baz", out_mask.ToJsonString())
      mask1.FromJsonString("foo.bar,bar")
      mask2.FromJsonString("foo.bar.baz,quz")
      out_mask.Intersect(mask1, mask2)
      self.assertEqual("foo.bar.baz", out_mask.ToJsonString())
  
imports: from datetime import datetime
  from google.protobuf import any_pb2
  from google.protobuf import duration_pb2
  from google.protobuf import field_mask_pb2
  from google.protobuf import struct_pb2
  from google.protobuf import timestamp_pb2
  from google.protobuf import unittest_pb2
  from google.protobuf.internal import any_test_pb2
  from google.protobuf.internal import test_util
  from google.protobuf.internal import well_known_types
  from google.protobuf import descriptor
  from google.protobuf import text_format
label_desc: Use image node_id 5 for calling the FieldMaskTest obj's underlying member method code with example usage: obj.testIntersect() without return types