input: 
  def port_java_to_python(java_code: str) -> str:
      """Port a given Java code snippet to Python 3.
      >>> port_java_to_python('public class Foo { public int foo(int a, int b) { return a + b; } }')
      'def foo(a, b): return a + b'
      >>> port_java_to_python('public class Bar { public String bar(String s) { return s + "!"; } }')
      'def bar(s): return s + "!"'
      """
  
output:     import re
  
      # Remove class definition and method signature
      java_code = re.sub(r'public class \w+ { public \w+ \w+\(.*\) {', '', java_code)
      java_code = re.sub(r'}', '', java_code)
  
      # Convert Java return type to Python
      java_code = re.sub(r'public \w+', 'def', java_code)
      java_code = re.sub(r'int ', '', java_code)
      java_code = re.sub(r'String ', '', java_code)
  
      # Remove semicolons
      java_code = re.sub(r';', '', java_code)
  
      return java_code.strip()