@Udf
  public <T> String join(
      @UdfParameter(description = "the array to join using the default delimiter '"
          + DEFAULT_DELIMITER + "'") final List<T> array
  ) {
    return join(array, DEFAULT_DELIMITER);
  }
@Test
  public void shouldReturnCorrectStringForFlatArraysWithPrimitiveTypes() {

    assertThat(arrayJoinUDF.join(Arrays.asList(true, null, false),""),
        is("truenullfalse")
    );
    assertThat(arrayJoinUDF.join(Arrays.asList(true, null, false)),
        is("true,null,false")
    );
    assertThat(arrayJoinUDF.join(Arrays.asList(true,null,false),CUSTOM_DELIMITER),
        is("true"+CUSTOM_DELIMITER+"null"+CUSTOM_DELIMITER+"false")
    );

    assertThat(arrayJoinUDF.join(Arrays.asList(1,23,-42,0),null), is("123-420"));
    assertThat(arrayJoinUDF.join(Arrays.asList(1,23,-42,0)), is("1,23,-42,0"));
    assertThat(arrayJoinUDF.join(Arrays.asList(1,23,-42,0),CUSTOM_DELIMITER),
        is("1"+CUSTOM_DELIMITER+"23"+CUSTOM_DELIMITER+"-42"+CUSTOM_DELIMITER+"0")
    );

    assertThat(arrayJoinUDF.join(Arrays.asList(-4294967297L, 8589934592L),""),
        is("-42949672978589934592")
    );
    assertThat(arrayJoinUDF.join(Arrays.asList(-4294967297L, 8589934592L)),
        is("-4294967297,8589934592")
    );
    assertThat(arrayJoinUDF.join(Arrays.asList(-4294967297L, 8589934592L), CUSTOM_DELIMITER),
        is("-4294967297"+CUSTOM_DELIMITER+"8589934592")
    );

    assertThat(arrayJoinUDF.join(Arrays.asList(1.23,-23.42,0.0),null),
        is("1.23-23.420.0")
    );
    assertThat(arrayJoinUDF.join(Arrays.asList(1.23,-23.42,0.0)),
        is("1.23,-23.42,0.0")
    );
    assertThat(arrayJoinUDF.join(Arrays.asList(1.23,-23.42,0.0),CUSTOM_DELIMITER),
        is("1.23"+CUSTOM_DELIMITER+"-23.42"+CUSTOM_DELIMITER+"0.0")
    );

    assertThat(arrayJoinUDF.join(
        Arrays.asList(new BigDecimal("123.45"), new BigDecimal("987.65")),null
        ),
        is("123.45987.65")
    );
    assertThat(arrayJoinUDF.join(Arrays.asList(new BigDecimal("123.45"), new BigDecimal("987.65"))),
        is("123.45,987.65")
    );
    assertThat(arrayJoinUDF.join(
        Arrays.asList(new BigDecimal("123.45"), new BigDecimal("987.65")),CUSTOM_DELIMITER),
        is("123.45"+CUSTOM_DELIMITER+"987.65")
    );

    assertThat(arrayJoinUDF.join(Arrays.asList("Hello","From","","Ksqldb","Udf"),""),
        is("HelloFromKsqldbUdf")
    );
    assertThat(arrayJoinUDF.join(Arrays.asList("Hello","From","","Ksqldb","Udf")),
        is("Hello,From,,Ksqldb,Udf")
    );
    assertThat(
        arrayJoinUDF.join(Arrays.asList("hello","from","","ksqldb","udf",null),CUSTOM_DELIMITER),
        is("hello"+CUSTOM_DELIMITER+"from"+CUSTOM_DELIMITER+CUSTOM_DELIMITER
            +"ksqldb"+CUSTOM_DELIMITER+"udf"+CUSTOM_DELIMITER+"null")
    );

  }