private void validateFunction(Method method) {
      if (!Modifier.isStatic(method.getModifiers())) {
        throw new IllegalArgumentException("Function calling only supports static methods.");
      }
    }
Validates that the given method is a static method.
java-vertexai/google-cloud-vertexai/src/main/java/com/google/cloud/vertexai/generativeai/AutomaticFunctionCallingResponder.java