public static AggregateFunctionInitArguments createAggregateFunctionInitArgs(
          final int numInitArgs,
          final FunctionCall functionCall
  ) {
    return createAggregateFunctionInitArgs(
            numInitArgs,
            Collections.emptyList(),
            functionCall,
            KsqlConfig.empty()
    );
  }
@Test
  public void shouldThrowIfSecondParamIsInitArgAndNotALiteral() {
    // Given:
    when(functionCall.getArguments()).thenReturn(ImmutableList.of(
        new UnqualifiedColumnReferenceExp(ColumnName.of("Bob")),
        new UnqualifiedColumnReferenceExp(ColumnName.of("Not good!")),
        new StringLiteral("No issue here")
    ));

    // When:
    final Exception e = assertThrows(
        KsqlException.class,
        () -> UdafUtil.createAggregateFunctionInitArgs(
                Math.max(0, functionCall.getArguments().size() - 1),
                Collections.singletonList(0),
                functionCall, KsqlConfig.empty()
        )
    );

    // Then:
    assertThat(e.getMessage(), is("Parameter 2 passed to function AGG must be a literal constant, "
        + "but was expression: 'Not good!'"));
  }