NewsModelImpl implements NewsModel { @Override public void loadNews(String url, final int type, final OnLoadNewsListListener listener) { OkHttpUtils.ResultCallback<String> loadNewsCallback = new OkHttpUtils.ResultCallback<String>() { @Override public void onSuccess(String response) { List<NewsBean> newsBeanList = NewsJsonUtils.readJsonNewsBeans(response, getID(type)); listener.onSuccess(newsBeanList); } @Override public void onFailure(Exception e) { listener.onFailure("load news list failure.", e); } }; OkHttpUtils.get(url, loadNewsCallback); }  @Override void loadNews(String url, final int type, final OnLoadNewsListListener listener); @Override void loadNewsDetail(final String docid, final OnLoadNewsDetailListener listener);  }
@Test public void testLoadNews() throws Exception { new NewsModelImpl().loadNews("http: new OkHttpUtils.ResultCallback<String>() { @Override public void onSuccess(String response) { } @Override public void onFailure(Exception e) { } }); }