@Module public class AppModule {
private Application application;
public AppModule(Application application) {
this.application = application;
}
@Provides @Singleton Context providesAppContext() {
return application.getApplicationContext();
}
@Provides @Singleton AppDatabase providesDatabase(Context context) {
return Room.inMemoryDatabaseBuilder(context, AppDatabase.class).build();
}
}