ParseDateFormat { Date parse(String dateString) { synchronized (lock) { try { return dateFormat.parse(dateString); } catch (java.text.ParseException e) { PLog.e(TAG, "could not parse date: " + dateString, e); return null; } } } private  ParseDateFormat(); static ParseDateFormat getInstance();  }
@Test public void testParse() { String string = "2015-05-13T11:08:01.123Z"; Date date = ParseDateFormat.getInstance().parse(string); assertEquals(1431515281123L, date.getTime()); }