Looking at the Google docs for ViewModel, they show the below sample code on how to get a ViewModel:
ViewModel
val model = ViewModelProviders
ViewModelProviders.of() has been deprecated.
Use ViewModelProvider constructors directly as they now handle the default ViewModelProvider.Factory role.
mainActivityViewModel = new ViewModelProvider(this).get(MainActivityViewModel.class);