docstr: ToDo: Inspired from spark 2.0. Review if spark changes
docstr_tok: ["ToDo",":","Inspired","from","spark","2.0.","Review","if","spark","changes"]
code: def new_java_array(self, pylist, java_class):
      """
      ToDo: Inspired from spark 2.0. Review if spark changes
      """
      java_array = self.sc._gateway.new_array(java_class, len(pylist))
      for i in range(len(pylist)):
          java_array[i] = pylist[i]
      return java_array
  
file_path: spark-nlp/python/sparknlp/internal/extended_java_wrapper.py
imports: from pyspark import SparkContext
  from pyspark.ml.wrapper import JavaWrapper
  from pyspark.sql import DataFrame
  from distutils.version import LooseVersion
label_desc: Use image node_id 5 for calling the ExtendedJavaWrapper obj's underlying member method code with example usage: obj.new_java_array(pylist, java_class) and returns: java_array