input: Write a function to translate a given Java code snippet to Python 3. The function should take the Java code as input and return the equivalent Python code.
  assert translate_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 translate_java_to_python("public class Bar { public int bar( int x, int y ) { return x * y; } }") == "def bar(x, y):\n return x * y"
output: def translate_java_to_python(java_code):
      method_start = java_code.find("public int")
      method_end = java_code.find("}", method_start)
      method_code = java_code[method_start:method_end].strip()
      
      method_name_start = method_code.find(" ") + 1
      method_name_end = method_code.find("(", method_name_start)
      method_name = method_code[method_name_start:method_name_end].strip()
      
      params_start = method_code.find("(", method_name_end) + 1
      params_end = method_code.find(")", params_start)
      params = method_code[params_start:params_end].split(",")
      params = [param.split()[-1] for param in params]
      
      body_start = method_code.find("{", params_end) + 1
      body_end = method_code.rfind("}")
      body = method_code[body_start:body_end].strip()
      
      python_code = f"def {method_name}({', '.join(params)}):\n return {body}"
      return python_code