TimeMathParser { @SuppressWarnings({"unused", "WeakerAccess"}) public static long nowInSeconds() { return TimeUnit.SECONDS.convert(System.currentTimeMillis(), TimeUnit.MILLISECONDS); }  @SuppressWarnings({"unused", "WeakerAccess"}) static long nowInSeconds(); @SuppressWarnings("WeakerAccess") static int resolutionInSeconds(String resolutionStr); @SuppressWarnings("WeakerAccess") static long parseTimeInSeconds(String timeStr); @SuppressWarnings("WeakerAccess") static long parseTime(String timeStr, TimeUnit timeUnit); @SuppressWarnings("WeakerAccess") static long parseTimeInSeconds(long now, String timeStr); @SuppressWarnings("WeakerAccess") static long parseTime(long now, String timeStr, TimeUnit timeUnit);  }
@Test public void testGetNowInSeconds() { long now = TimeUnit.SECONDS.convert(System.currentTimeMillis(), TimeUnit.MILLISECONDS); long result = TimeMathParser.nowInSeconds(); Assert.assertTrue((result - now == 1) || result == now); }