TimeWindow { public static TimeWindow of(int resolution, long period, String name) { return new TimeWindow(resolution, period, name); } private  TimeWindow(int resolution, long period, String name); String getName(); int getResolution(); long getPeriod(); static TimeWindow of(int resolution, long period, String name); int getBuckets();  }
@Test(expected=IllegalArgumentException.class) public void constructionShouldRejectZeroPeriod() { TimeWindow.of(100, 0, "foo"); }
@Test(expected=IllegalArgumentException.class) public void constructionShouldRejectZeroResolution() { TimeWindow.of(0, 400, "foo"); }
@Test(expected=IllegalArgumentException.class) public void constructionShouldRejectMoreThanMaxintWindows() { TimeWindow.of(1000, 4000000000000L, "foo"); }
@Test(expected=IllegalArgumentException.class) public void constructionShouldRejectPeriodNotMultipleOfResolution() { TimeWindow.of(3, 10, "foo"); }