@Test
public void testDivide() {

    // nominator is 0, result should be 0.
    Assert.assertEquals(0, TimeValue.ofMilliseconds(0).divide(2).toDays());
    Assert.assertEquals(0, TimeValue.ofMilliseconds(0).divide(2).toHours());
    Assert.assertEquals(0, TimeValue.ofMilliseconds(0).divide(2).toMicroseconds());
    Assert.assertEquals(0, TimeValue.ofMilliseconds(0).divide(2).toMilliseconds());
    Assert.assertEquals(0, TimeValue.ofMilliseconds(0).divide(2).toMinutes());
    Assert.assertEquals(0, TimeValue.ofMilliseconds(0).divide(2).toNanoseconds());
    Assert.assertEquals(0, TimeValue.ofMilliseconds(0).divide(2).toSeconds());
    Assert.assertEquals(0, TimeValue.ofMilliseconds(0).divide(2).toMillisecondsIntBound());
    Assert.assertEquals(0, TimeValue.ofMilliseconds(0).divide(2).toSecondsIntBound());
    //
    Assert.assertEquals(50, TimeValue.ofMilliseconds(100).divide(2).toMilliseconds());
    Assert.assertEquals(0, TimeValue.ofMinutes(1).divide(2).toSeconds());
    Assert.assertEquals(30, TimeValue.ofMinutes(1).divide(2, TimeUnit.SECONDS).toSeconds());
    Assert.assertEquals(30000, TimeValue.ofMinutes(1).divide(2, TimeUnit.MILLISECONDS).toMilliseconds());
}