@Test
  public void fromJsonStringStringIsNull_throwsIllegalArgumentException()
      throws InvalidProtocolBufferException {
    String jsonString = null;

    IllegalArgumentException thrown =
        assertThrows(
            IllegalArgumentException.class,
            () -> FunctionDeclarationMaker.fromJsonString(jsonString));
    assertThat(thrown).hasMessageThat().isEqualTo("Input String can't be null or empty.");
  }
A function with invalid parameter type to test fromFunc.
java-vertexai/google-cloud-vertexai/src/test/java/com/google/cloud/vertexai/generativeai/FunctionDeclarationMakerTest.java