public static long computeStartOfNextSecond(long now) {
        Calendar cal = Calendar.getInstance();
        cal.setTime(new Date(now));
        cal.set(Calendar.MILLISECOND, 0);
        cal.add(Calendar.SECOND, 1);
        return cal.getTime().getTime();
    }
@Test
    public void testSecond() {
        // Mon Nov 20 18:05:17,522 CET 2006
        long now = 1164042317522L;
        // Mon Nov 20 18:05:18,000 CET 2006
        long expected = 1164042318000L;
        long computed = TimeUtil.computeStartOfNextSecond(now);
        Assertions.assertEquals(expected - now, 478);
        Assertions.assertEquals(expected, computed);
    }