input: Write a function to create an instance of the "sru" class and perform a search using the "search" method. The function should take a query string, an optional collection name, start record number, maximum number of records to return, and a record schema. The function should return a list of titles extracted from the search results. If the search returns no results, the function should return an empty list.
  
  def search_and_get_titles(query, collection=False, startrecord=1, maxrecords=1, recordschema=False):
      sru_instance = sru()
      search_response = sru_instance.search(query, collection, startrecord, maxrecords, recordschema)
      if search_response:
          return search_response.titles
      return []
  
  assert search_and_get_titles("Python programming", collection="GGC", maxrecords=5) == ['Python Programming', 'Advanced Python', 'Python for Beginners', 'Python Data Structures', 'Python Algorithms']
  assert search_and_get_titles("machine learning", collection="DPO", maxrecords=3) == ['Introduction to Machine Learning', 'Machine Learning in Python', 'Advanced Machine Learning']
  assert search_and_get_titles("Non-Existent Query") == []
  assert search_and_get_titles("history", collection="BYVANCK", maxrecords=2) == ['Medieval History', 'Renaissance History']
output: def search_and_get_titles(query, collection=False, startrecord=1, maxrecords=1, recordschema=False):
      sru_instance = sru()
      search_response = sru_instance.search(query, collection, startrecord, maxrecords, recordschema)
      if search_response:
          return search_response.titles
      return []