class PagedList extends PagerBase<Type> {

    @WorkerThread
    public boolean initializeFrom(PagedList<Type> old) {
        // Note: even though old may be actively used on the foreground thread, we carefully only
        // access parts that are immutable once old is invalid:
        // mAnchor, and mItems (since no further prepends/appends can occur)

        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 public <Key> PagedList(@NonNull DataSource<Key, Type> dataSource,
            @NonNull Executor mainThreadExecutor, @NonNull Executor backgroundThreadExecutor,
            @NonNull ListConfig config);

}