input: Write a function to port a given Java code snippet to Python 3. The function should accept a Java code snippet as input and return the corresponding Python code snippet. If the input Java code snippet is empty, the function should return an empty string.
  assert port_java_to_python("public class Foo { public int foo( int a, int b ) { return a + b; } }")=="def foo(a, b):\n return a + b"
  assert port_java_to_python("public class Bar { public int bar( int x, int y ) { return x * y; } }")=="def bar(x, y):\n return x * y"
  assert port_java_to_python("")==""
  assert port_java_to_python("public class Baz { public void baz() { } }")=="def baz():\n pass"
  assert port_java_to_python("public class FooBar { public String fooBar( String s ) { return s + \"bar\"; } }")=="def fooBar(s):\n return s + \"bar\""
output: def port_java_to_python(java_code):
      if not java_code:
          return ""
      method_name = java_code.split("public")[2].split("(")[0].strip()
      params = java_code.split("(")[1].split(")")[0].split(", ")
      param_list = ", ".join([p.split(" ")[1] for p in params])
      return_type = java_code.split("public")[2].split(" ")[1]
      if return_type == "void":
          return f"def {method_name}({param_list}):\n pass"
      else:
          return_statement = java_code.split("return")[1].split(";")[0].strip()
          return f"def {method_name}({param_list}):\n return {return_statement}"