@Test
public void testInitDelay() {

    int stepSize = 60000;//60s ,6
    long now = 1522675416000l;//min+16s=416
    long min = now / stepSize * stepSize;
    //380-544 ,
    //System.out.println(stepBoundary + "," + (stepBoundary + stepSize));
    long val = ReScheduleSupport.getInitialDelay(60000, new ManualClock(now, 1l));
    Assert.assertEquals(now - min, val);
    System.out.println("=============================too small===================");
    now = 1522675385000l;
    min = now / stepSize * stepSize;
    System.out.println(min + "," + (min + stepSize));
    val = ReScheduleSupport.getInitialDelay(60000, new ManualClock(now, 1l));
    Assert.assertEquals(now - min + stepSize / 10, val);
    System.out.println("=============================too big===================");
    now = 1522675440000l - 3000l;
    min = now / stepSize * stepSize;
    long max = min + stepSize;
    System.out.println(min + "," + max);
    val = ReScheduleSupport.getInitialDelay(60000, new ManualClock(now, 1l));
    Assert.assertEquals(stepSize - (max - now + stepSize / 10), val);
}