InvalidationTracker { @SuppressWarnings("WeakerAccess") public void refreshVersionsAsync() { if (mPendingRefresh.compareAndSet(false, true)) { mDatabase.getQueryExecutor().execute(mRefreshRunnable); } } @SuppressWarnings("WeakerAccess") @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP_PREFIX)  InvalidationTracker(RoomDatabase database, String... tableNames); @SuppressWarnings("WeakerAccess") @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP_PREFIX)  InvalidationTracker(RoomDatabase database, Map<String, String> shadowTablesMap,
            Map<String, Set<String>> viewTables, String... tableNames); @SuppressLint("RestrictedApi") @WorkerThread void addObserver(@NonNull Observer observer); @SuppressWarnings("unused") @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP_PREFIX) void addWeakObserver(Observer observer); @SuppressLint("RestrictedApi") @SuppressWarnings("WeakerAccess") @WorkerThread void removeObserver(@NonNull final Observer observer); @SuppressWarnings("WeakerAccess") void refreshVersionsAsync(); @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP_PREFIX) @WorkerThread void refreshVersionsSync(); @RestrictTo(RestrictTo.Scope.LIBRARY) @VisibleForTesting(otherwise = VisibleForTesting.PACKAGE_PRIVATE) void notifyObserversByTableNames(String... tables); @Deprecated @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP_PREFIX) LiveData<T> createLiveData(String[] tableNames, Callable<T> computeFunction); @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP_PREFIX) LiveData<T> createLiveData(String[] tableNames, boolean inTransaction,
            Callable<T> computeFunction);  }
@Test public void refreshCheckTasks() throws Exception { when(mRoomDatabase.query(any(SimpleSQLiteQuery.class))).thenReturn(mock(Cursor.class)); mTracker.refreshVersionsAsync(); mTracker.refreshVersionsAsync(); verify(mTaskExecutorRule.getTaskExecutor()).executeOnDiskIO(mTracker.mRefreshRunnable); drainTasks(); reset(mTaskExecutorRule.getTaskExecutor()); mTracker.refreshVersionsAsync(); verify(mTaskExecutorRule.getTaskExecutor()).executeOnDiskIO(mTracker.mRefreshRunnable); }