TweetDateUtils { static long apiTimeToLong(String apiTime) { if (apiTime == null) return INVALID_DATE; try { return DATE_TIME_RFC822.parse(apiTime).getTime(); } catch (ParseException e) { return INVALID_DATE; } } private  TweetDateUtils();   }
@Test public void testApiTimeToLong_jacksFirstTweet() { assertEquals(JACKS_FIRST_TWEET_IN_MILLIS, TweetDateUtils.apiTimeToLong("Tue Mar 21 20:50:14 +0000 2006")); }
@Test public void testApiTimeToLong_emptyString() { assertEquals(TweetDateUtils.INVALID_DATE, TweetDateUtils.apiTimeToLong("")); }
@Test public void testApiTimeToLong_nullString() { assertEquals(TweetDateUtils.INVALID_DATE, TweetDateUtils.apiTimeToLong(null)); }
@Test public void testApiTimeToLong_invalidString() { assertEquals(TweetDateUtils.INVALID_DATE, TweetDateUtils.apiTimeToLong("11111")); }