def METHOD_NAME(java_file_path, java_file):
  """Returns the top-level Java class and header file path tuple.
  Args:
    java_file_path: The file path of the source Java file.
    java_file: The actual file of the source java file.
  Returns:
    A tuple containing top-level Java class and associated header file path. Or
    None if no package statement exists in the source file.
  """
  for line in java_file:
    stripped_line = line.strip()
    stripped_line_str = stripped_line
    if isinstance(stripped_line, bytes):
      stripped_line_str = stripped_line.decode('utf-8', 'strict')
    elif not isinstance(stripped_line, (str, bytes)):
      raise TypeError("not expecting type '%s'" % type(stripped_line_str))
    package_statement = _PACKAGE_RE.search(stripped_line_str)
    # We identified a potential package statement.
    if package_statement:
      preceding_characters = stripped_line[0:package_statement.start(1)]
      # We have preceding characters before the package statement. We need to
      # look further into them.
      if preceding_characters:
        # Skip comment line.
        if preceding_characters.startswith('//'):
          continue
        # Preceding characters also must end with a space, represent an end
        # of comment, or end of a statement.
        # Otherwise, we skip the current line.
        if not (preceding_characters[len(preceding_characters) - 1].isspace() or
                preceding_characters.endswith(';') or
                preceding_characters.endswith('*/')):
          continue
      package_name = package_statement.group(2)
      class_name = os.path.splitext(os.path.basename(java_file_path))[0]
      header_file = os.path.splitext(java_file_path)[0] + '.h'
      return (package_name + '.' + class_name, header_file)
  return None