input: Write a function to port a given Java code snippet to Python 3. The function should take the Java code as input and return the corresponding Python code as output. If the input Java code is empty, the function should return an empty string.
  assert port_java_to_python("public class Foo {\n  public int foo( int a, int b ) {\n    return a + b;\n  }\n}") == "def foo(a, b):\n return a + b"
  assert port_java_to_python("public class Bar {\n  public int bar( int x ) {\n    return x * 2;\n  }\n}") == "def bar(x):\n return x * 2"
  assert port_java_to_python("") == ""
output: def port_java_to_python(java_code):
      if not java_code:
          return ""
      lines = java_code.split('\n')
      method_line = lines[1]
      method_name = method_line.split()[2].split('(')[0]
      params = method_line.split('(')[1].split(')')[0].split(', ')
      param_names = [param.split(' ')[1] for param in params]
      return_line = lines[2]
      return_value = return_line.split('return ')[1].strip()
      python_code = f"def {method_name}({', '.join(param_names)}):\n return {return_value}"
      return python_code