### Question:
MainViewModel extends AndroidViewModel { @Override protected void onCleared() { try { rmConnector.stop(); } catch (RightMeshException.RightMeshServiceDisconnectedException e) { Log.e(TAG, "Service disconnected before stopping AndroidMeshManager with message" + e.getMessage()); } } MainViewModel(@NonNull Application application); void setRightMeshConnector(RightMeshConnector rmConnector);  }### Answer:
@Test public void onCleared_isCalled() throws RightMeshException { spyViewModel.onCleared(); verify(rightMeshConnector).stop(); verify(spyViewModel).onCleared(); }