input: from typing import List
  
  
  def port_java_to_python(java_code: str) -> str:
      """Given a Java code snippet, port it to Python 3.
      >>> 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:     import re
  
      # Remove Java class declaration
      java_code = re.sub(r'public\s+class\s+\w+\s*\{', '', java_code)
      java_code = re.sub(r'\}\s*$', '', java_code)
  
      # Remove Java method modifiers
      java_code = re.sub(r'public\s+', '', java_code)
      java_code = re.sub(r'private\s+', '', java_code)
      java_code = re.sub(r'protected\s+', '', java_code)
  
      # Convert Java method to Python function
      java_code = re.sub(r'(\w+)\s+(\w+)\s*\(([^)]*)\)\s*\{', r'def \2(\3):\n', java_code)
  
      # Convert return statement
      java_code = re.sub(r'return\s+', 'return ', java_code)
  
      # Remove Java-specific syntax
      java_code = re.sub(r';', '', java_code)
      java_code = re.sub(r'int\s+', '', java_code)
      java_code = re.sub(r'String\s+', '', java_code)
      java_code = re.sub(r'boolean\s+', '', java_code)
      java_code = re.sub(r'void\s+', '', java_code)
  
      # Add indentation
      java_code = re.sub(r'\n', '\n    ', java_code)
  
      return java_code.strip()