TimeInterval { public static TimeInterval withMillis(long millis) { validateLength(millis); return new TimeInterval(null, millis); } private  TimeInterval(TimeIntervalType type, long length); static TimeInterval withMillis(long millis); static TimeInterval withTypeAndLength(TimeIntervalType type, int length); DateTime getIntervalStart(DateTime instant); DateTime plus(DateTime instant, int multiple); DateTime minus(DateTime instant, int multiple); boolean isPeriod(); @JsonProperty("length") long getLength(); @JsonProperty("type") TimeIntervalType getType(); @Deprecated long toApproxMillis(); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString(); static final TimeInterval INFINITE; static final TimeInterval ZERO; }
@Test( groups = "fast", expectedExceptions = {IllegalArgumentException.class}, expectedExceptionsMessageRegExp = "length cannot be less than one: 0") public void testInvalidMillis() { TimeInterval.withMillis(0); }