input: Write a function to filter a list of email addresses and return only those that belong to a specific domain. The function should take the list of emails and the domain as input and return the filtered list.
  
  
  def filter_emails_by_domain(emails, domain):
      return [email for email in emails if email.endswith(domain)]
  
  # Test cases
  assert filter_emails_by_domain(["john@gmail.com", "sarah@yahoo.com", "bob@microsoft.com", "sophie@gmail.com"], "@gmail.com")==["john@gmail.com", "sophie@gmail.com"]
  assert filter_emails_by_domain(["alex@yahoo.com", "sam@hotmail.com", "adam@yahoo.com"], "@yahoo.com")==["alex@yahoo.com", "adam@yahoo.com"]
  assert filter_emails_by_domain([], "@gmail.com")==[]
  assert filter_emails_by_domain(["mike@example.com"], "@gmail.com")==[]
  
output: def filter_emails_by_domain(emails, domain):
      return [email for email in emails if email.endswith(domain)]