How and can you create test data for espresso? (Android)

Im using RecyclerView and room for my app. I started writing the ui tests using Espresso, and for example when i display the main activity a recyclerView is shown with data from the database. Is there a way to use test data for espresso? or create a test database?