Here you can find the source of advanceCurrentTimeSeconds()
public static void advanceCurrentTimeSeconds() throws InterruptedException
//package com.java2s; // Licensed under the Apache License, Version 2.0 (the "License"); public class Main { /**/*ww w.j a va 2 s .c om*/ * Wait until the {@link System#currentTimeMillis} / 1000 advances. * * This method takes 0-1000ms to run, 500ms on average. */ public static void advanceCurrentTimeSeconds() throws InterruptedException { long currentTimeSeconds = System.currentTimeMillis() / 1000; do { Thread.sleep(50); } while (currentTimeSeconds == System.currentTimeMillis() / 1000); } }