code: def test_to_integer_array(values, to_dtype, result_dtype):
      # convert existing arrays to IntegerArrays
      result = IntegerArray._from_sequence(values, dtype=to_dtype)
      assert result.dtype == result_dtype()
      expected = pd.array(values, dtype=result_dtype())
      tm.assert_extension_array_equal(result, expected)
  
imports: import numpy
  import pytest
  import pandas
  import pandas._testing
  from pandas.api.types import is_integer
  from pandas.core.arrays import IntegerArray
  from pandas.core.arrays.integer import Int8Dtype, Int32Dtype, Int64Dtype
label_desc: Use image node_id 14 for calling a global function with example usage: test_to_integer_array(values, to_dtype, result_dtype) without return types