class LoaderQueryRunner implements ContentPager.QueryRunner {

    @Override
    @SuppressWarnings("unchecked")  // feels spurious. But can't commit line :80 w/o this.
    public void query(final @NonNull Query query, @NonNull final Callback callback) {
        if (DEBUG) Log.d(TAG, "Handling query: " + query);

        LoaderCallbacks callbacks = new LoaderCallbacks<Cursor>() {
            @Override
            public Loader<Cursor> onCreateLoader(final int id, final Bundle args) {
                if (DEBUG) Log.i(TAG, "Loading results for query: " + query);
                checkArgument(id == query.getId(), "Id doesn't match query id.");

                return new android.content.CursorLoader(mContext) {
                    @Override
                    public Cursor loadInBackground() {
                        return callback.runQueryInBackground(query);
                    }
                };
            }

            @Override
            public void onLoadFinished(Loader<Cursor> loader, Cursor cursor) {
                if (DEBUG) Log.i(TAG, "Finished loading: " + query);
                mLoaderMgr.destroyLoader(query.getId());
                callback.onQueryFinished(query, cursor);
            }

            @Override
            public void onLoaderReset(Loader<Cursor> loader) {
                if (DEBUG) Log.w(TAG, "Ignoring loader reset for query: " + query);
            }
        };

        mLoaderMgr.restartLoader(query.getId(), null, callbacks);
    }

    public  LoaderQueryRunner(@NonNull Context context, @NonNull LoaderManager loaderMgr);

}