### Question:
MainActivityViewModel extends ViewModel { void addStudent(@NonNull String student) { repository.addStudent(student); } MainActivityViewModel(@NonNull Repository repository);   }### Answer:
@Test public void testAddStudent() { String studentToAdd = "German"; viewModel.addStudent(studentToAdd); Mockito.verify(repository).addStudent(studentToAdd); }