JSONExtractor { public List<UsageStatistic> getSingleUserUsageYearMonthDay(String user, String year, String month, String day) throws IOException, DatabaseFileNotFoundException { Predicate<FilterUserTimeInterval> ymdPredicate = FilterUserTimeInterval::filterDay; return getSingleUserDate(ymdPredicate, user, year, month, day); }  List<UsageStatistic> loadStatisticOf(String date); Map<String, List<UsageStatistic>> getAllUserUsageStatistic(String date); List<UsageStatistic> getUsageStatisticsSince(String startDate); Map<String, List<UsageStatistic>> getAllUserUsageBetween(String startDate, String endDate); Map<String, List<UsageStatistic>> getAllDateUsageBetween(String startDate, String endDate); Map<String, List<UsageStatistic>> getAllQueueUsageBetween(String startDate, String endDate); UsageStatistic getSingleStatistic(String jobId, String date); List<UsageStatistic> getSingleUserStatistic(String userName, String date); List<UsageStatistic> getSingleUserUsageBetween(String user, String startDate, String endDate); List<UsageStatistic> getSingleUserUsageInYear(String user, String year); List<UsageStatistic> getSingleUserUsageInYearMonth(String user, String year, String month); List<UsageStatistic> getSingleUserUsageYearMonthDay(String user, String year, String month,
                                                               String day);  }
@Test public void testUSerStatisticInYearMonthDay() throws Exception { List<UsageStatistic> usageStatisticList = jsonExtractor.getSingleUserUsageYearMonthDay("martin", "2017", "01", "09"); assertEquals(usageStatisticList.size(), 5); UsageStatistic usageStatistic = usageStatisticList.get(0); assertThat(usageStatistic.getJobId(), equalTo("job_1481485063251_15808")); assertThat(usageStatistic.getUser(), equalTo("martin")); assertThat(usageStatistic.getQueue(), equalTo("lc")); assertThat(usageStatistic.getStartTime(), equalTo(1483794176512L)); assertThat(usageStatistic.getFinishTime(), equalTo(1483942744578L)); assertThat(usageStatistic.getMapsCompleted(), equalTo(694)); assertThat(usageStatistic.getReducesCompleted(), equalTo(0)); assertThat(usageStatistic.getState(), equalTo("SUCCEEDED")); assertThat(usageStatistic.getInputPath(), equalTo("hdfs: assertThat(usageStatistic.getFileBytesRead(), equalTo(0L)); assertThat(usageStatistic.getFileBytesWritten(), equalTo(186692272L)); assertThat(usageStatistic.getHdfsBytesRead(), equalTo(732875870L)); assertThat(usageStatistic.getHdfsBytesWritten(), equalTo(1148345579L)); assertThat(usageStatistic.getvCoresMillisTotal(), equalTo(148076365L)); assertThat(usageStatistic.getMbMillisMapTotal(), equalTo(909781186560L)); assertThat(usageStatistic.getCpuMilliseconds(), equalTo(29974960L)); }