AuthTimeDateConverter { public static Long dateToAuthTime(Date date) { if (null != date) { return date.getTime() / 1000; } return null; }  static Date authTimeToDate(Integer authTime); static Long dateToAuthTime(Date date);  }
@Test public void dateToAuthTime_whenNull() { Long authTime = AuthTimeDateConverter.dateToAuthTime(null); assertNull(authTime); }
@Test public void dateToAuthTime_whenNotNull() { long authTime = AuthTimeDateConverter.dateToAuthTime(new Date(1000l)); assertEquals(1, authTime); }