synchronized void addFunction(final KsqlScalarFunction ksqlFunction) {
    checkCompatible(ksqlFunction);
    udfIndex.addFunction(ksqlFunction);
  }
@Test
  public void shouldThrowExceptionIfAddingFunctionWithDifferentPath() {
    // When:
    final Exception e = assertThrows(
        KafkaException.class,
        () -> factory.addFunction(create(
            (params, args) -> STRING,
            ParamTypes.STRING,
            emptyList(),
            FunctionName.of("TestFunc"),
            TestFunc.class,
            ksqlConfig -> null,
            "",
            "not the same path",
            false
        ))
    );

    // Then:
    assertThat(e.getMessage(), containsString(
        "as a function with the same name has been loaded from a different jar"));
  }