code: def test_union(self, closed, sort):
      index = monotonic_index(0, 11, closed=closed)
      other = monotonic_index(5, 13, closed=closed)
  
      expected = monotonic_index(0, 13, closed=closed)
      result = index[::-1].union(other, sort=sort)
      if sort in (None, True):
          tm.assert_index_equal(result, expected)
      else:
          tm.assert_index_equal(result.sort_values(), expected)
  
      result = other[::-1].union(index, sort=sort)
      if sort in (None, True):
          tm.assert_index_equal(result, expected)
      else:
          tm.assert_index_equal(result.sort_values(), expected)
  
      tm.assert_index_equal(index.union(index, sort=sort), index)
      tm.assert_index_equal(index.union(index[:1], sort=sort), index)
  
file_path: pandas/pandas/tests/indexes/interval/test_setops.py
imports: import numpy
  import pytest
  from pandas import Index, IntervalIndex, Timestamp, interval_range
  import pandas._testing
label_desc: Use image node_id 1 for calling the TestIntervalIndex obj's underlying member method code with example usage: obj.test_union(closed, sort) without return types