DateUtils { public static Map<String, String> getFilteredTimeZoneMap() { if (timezoneIDMap == null) { timezoneIDMap = new LinkedHashMap<String, String>(); String[] ids = TimeZone.getAvailableIDs(); for (String id : ids) { TimeZone zone = TimeZone.getTimeZone(id); int offset = zone.getRawOffset(); int offsetSecond = offset / CONSTANT_1000; int hour = offsetSecond / (CONSTANT_60 * CONSTANT_60); int minutes = (offsetSecond % (CONSTANT_60 * CONSTANT_60)) / CONSTANT_60; timezoneIDMap.put(TimeZone.getTimeZone(id).getDisplayName(), String.format("(GMT%+d:%02d) %s", hour, minutes, id)); } } return timezoneIDMap; }  static long getCollectTimeInLong(Date date); static Date convertToServerDate(String userTimeZone, Date userDate); static Date convertToUserDate(String userTimeZone, Date serverDate); static String dateToString(Date date); static Map<String, String> getFilteredTimeZoneMap(); static Date toSimpleDate(String strDate); static Date toDate(String strDate); static Date addDay(Date date, int days); static String ms2Time(long ms); static long timeToMs(int day, int hour, int min, int sec); static boolean compareDateEndWithMinute(Date d1, Date d2);  }
@Test public void testGetFilteredTimeZoneMap() { Map<String, String> tzMap = DateUtils.getFilteredTimeZoneMap(); assertThat(tzMap, notNullValue()); tzMap = DateUtils.getFilteredTimeZoneMap(); assertThat(tzMap, notNullValue()); }