input: Write a function to port a Java code snippet to Python 3. The function should take a Java code snippet as input and return the equivalent Python 3 code. The Java code snippet will always be a simple class with a single method that performs a basic arithmetic operation.
  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"
output: def port_java_to_python(java_code):
      import re
      match = re.search(r'public\s+int\s+(\w+)\s*\(\s*int\s+(\w+)\s*,\s*int\s+(\w+)\s*\)\s*\{\s*return\s+(\w+)\s*([+\-*/])\s*(\w+)\s*;\s*\}', java_code)
      if match:
          method_name = match.group(1)
          param1 = match.group(2)
          param2 = match.group(3)
          op = match.group(5)
          return f"def {method_name}({param1}, {param2}):\n return {param1} {op} {param2}"