code: def test_jvm_array(root_allocator, pa_type, py_data, jvm_type):
      # Create vector
      cls = "org.apache.arrow.vector.{}".format(jvm_type)
      jvm_vector = jpype.JClass(cls)("vector", root_allocator)
      jvm_vector.allocateNew(len(py_data))
      for i, val in enumerate(py_data):
          # char and int are ambiguous overloads for these two setSafe calls
          if jvm_type in {"UInt1Vector", "UInt2Vector"}:
              val = jpype.JInt(val)
          jvm_vector.setSafe(i, val)
      jvm_vector.setValueCount(len(py_data))
  
      py_array = pa.array(py_data, type=pa_type)
      jvm_array = pa_jvm.array(jvm_vector)
  
      assert py_array.equals(jvm_array)
  
file_path: arrow/python/pyarrow/tests/test_jvm.py
imports: import json
  import os
  import pyarrow
  import pyarrow.jvm
  import pytest
  import sys
  import xml.etree.ElementTree
label_desc: Use image node_id 7 for calling a global function with example usage: test_jvm_array(root_allocator, pa_type, py_data, jvm_type) without return types