@Test
  public void fromFuncWithParameterNames_returnsFunctionDeclaration() throws NoSuchMethodException {
    Method function =
        FunctionDeclarationMakerTest.class.getMethod(
            FUNCTION_NAME, String.class, int.class, double.class, float.class, boolean.class);

    FunctionDeclaration functionDeclaration =
        FunctionDeclarationMaker.fromFunc(
            FUNCTION_DESCRIPTION,
            function,
            STRING_PARAM_NAME,
            INTEGER_PARAM_NAME,
            DOUBLE_PARAM_NAME,
            FLOAT_PARAM_NAME,
            BOOLEAN_PARAM_NAME);

    assertThat(functionDeclaration).isEqualTo(EXPECTED_FUNCTION_DECLARATION);
  }
A function with invalid parameter type to test fromFunc.
java-vertexai/google-cloud-vertexai/src/test/java/com/google/cloud/vertexai/generativeai/FunctionDeclarationMakerTest.java