title: Java Spark - Multiple value check on Spark dataframe column while using when condition
body: <p>I have a dataframe where I am creating a column and populating values based on conditions in other columns.</p>
  
  <pre><code>List&lt;String&gt; new_lst = new ArrayList&lt;String&gt;();
  new_lst.add("value 1");
  new_lst.add("value_2");
  
  df_new = df.withColumn("new_column",functions.when(functions.col("col_1").equalTo("A")
  .and(functions.col("col_2").isin(new_lst.stream().toArray(String[]::new)),functions.col("col_3"))
  .otherwise(functions.col("col_1");
  </code></pre>
  
  <p>When i use the above i get a warning that </p>
  
  <blockquote>
    <p>Confusing argument new_lst.stream().toArray(String[]::new, unclear if
    a varargs or non-varargs call is desired</p>
  </blockquote>
  
  <p>My requirement is that i am creating a column called new_column by check if col_1 is equal to A and 
  col_2 has value_1 and value_2 then i have to get values from col_3, else from col_1.</p>
  
  <p>Kindly let me know the best way to implement this in java spark. </p>