PagedList extends PagerBase<Type> { @WorkerThread public boolean initializeFrom(PagedList<Type> old) { int targetIndex = (old.mAnchor + old.mInterestedKeyOffset); int loadAfterIndex = Math.max(0, targetIndex - mConfig.mPageSize / 2) - 1; Object loadAfterKey = null; if (loadAfterIndex >= 0) { Type loadAfterItem = old.mItems.get(loadAfterIndex); loadAfterKey = mDataSource.getKey(loadAfterItem); } List<Type> initialData = mDataSource.loadAfterInitial(loadAfterKey, mConfig.mPageSize); if (initialData != null) { setInitialDataAndDispatch(initialData); mInitialized = true; return true; } else { freeze(); return false; } } @WorkerThread <Key> PagedList(@NonNull DataSource<Key, Type> dataSource,
            @NonNull Executor mainThreadExecutor, @NonNull Executor backgroundThreadExecutor,
            @NonNull ListConfig config); @Override @NonNull Type get(int index); @Override @NonNull Type access(int index); @Override int size(); @MainThread void triggerInitialLoad(final Key initialLoadKey); @WorkerThread boolean initializeFrom(PagedList<Type> old); @SuppressWarnings("WeakerAccess") void addCallback(ChangeCallback callback); @SuppressWarnings("WeakerAccess") void removeCallback(ChangeCallback callback);  }
@Test public void initializeFrom() { PagedList<User> pagedList = createPagedList(20, 20); pagedList.triggerInitialLoad(null); drain(); }