input: Write a function that converts a given Java code snippet into Python 3. The function should take a string representation of the Java code and return the equivalent Python code as a 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 ) { return x * 2; } }") == "def bar(x):\n return x * 2"
  assert port_java_to_python("public class Baz { public String baz() { return \\"Hello\\"; } }") == "def baz():\n return \"Hello\""
  assert port_java_to_python("") == ""
  assert port_java_to_python("public class Qux { public void qux() {} }") == "def qux():\n pass"
output: def port_java_to_python(java_code):
      if not java_code:
          return ""
      java_code = java_code.replace("public class ", "").replace("{", "").replace("}", "").strip()
      parts = java_code.split("public")
      class_name = parts[0].strip()
      method_parts = parts[1].strip().split(" ")
      return_type = method_parts[1]
      method_name = method_parts[2].split("(")[0]
      params = method_parts[2].split("(")[1].split(")")[0].split(", ")
      param_names = [p.split(" ")[1] for p in params]
      return_statement = "return " + method_parts[3].split(";")[0].strip() if return_type != "void" else "pass"
      return f"def {method_name}({', '.join(param_names)}):\n {return_statement}"