### Question:
WxMaAnalysisServiceImpl implements WxMaAnalysisService { @Override public List<WxMaVisitTrend> getWeeklyVisitTrend(Date beginDate, Date endDate) throws WxErrorException { return getAnalysisResultAsList(GET_WEEKLY_VISIT_TREND_URL, beginDate, endDate, new TypeToken<List<WxMaVisitTrend>>() { }.getType()); } WxMaAnalysisServiceImpl(WxMaService wxMaService); @Override List<WxMaSummaryTrend> getDailySummaryTrend(Date beginDate, Date endDate); @Override List<WxMaVisitTrend> getDailyVisitTrend(Date beginDate, Date endDate); @Override List<WxMaVisitTrend> getWeeklyVisitTrend(Date beginDate, Date endDate); @Override List<WxMaVisitTrend> getMonthlyVisitTrend(Date beginDate, Date endDate); @Override WxMaVisitDistribution getVisitDistribution(Date beginDate, Date endDate); @Override WxMaRetainInfo getDailyRetainInfo(Date beginDate, Date endDate); @Override WxMaRetainInfo getWeeklyRetainInfo(Date beginDate, Date endDate); @Override WxMaRetainInfo getMonthlyRetainInfo(Date beginDate, Date endDate); @Override List<WxMaVisitPage> getVisitPage(Date beginDate, Date endDate); @Override WxMaUserPortrait getUserPortrait(Date beginDate, Date endDate);  }### Answer:
@Test public void testGetWeeklyVisitTrend() throws Exception { Calendar calendar = Calendar.getInstance(); calendar.set(Calendar.DAY_OF_WEEK, Calendar.SUNDAY); Date now = new Date(); Date lastSunday = calendar.getTime(); if (DateUtils.isSameDay(lastSunday, now)) { lastSunday = DateUtils.addDays(lastSunday, -7); } Date lastMonday = DateUtils.addDays(lastSunday, -6); final WxMaAnalysisService service = wxMaService.getAnalysisService(); List<WxMaVisitTrend> trends = service.getWeeklyVisitTrend(lastMonday, lastSunday); assertEquals(1, trends.size()); System.out.println(trends); }