DeleterThreshold extends StorageThreshold implements Comparable<DeleterThreshold> { public boolean match(Calendar cal) { return schedule == null || schedule.contains(cal); } DeleterThreshold(String value, long minUsableSpace, ScheduleExpression schedule); static DeleterThreshold valueOf(String s); String getPrefix(); boolean match(Calendar cal); @Override int compareTo(DeleterThreshold o);  }
@Test public void testMatch() throws Exception { DeleterThreshold threshold = DeleterThreshold.valueOf("10_[hour=18-6]10GB"); assertFalse(threshold.match(new GregorianCalendar(2015, 9, 8, 10, 0))); assertTrue(threshold.match(new GregorianCalendar(2015, 9, 8, 18, 0))); }