### Question:
SmwSystem extends MediaWikiSystem { public static Date getTime(String timeString) { timeString = timeString.substring(2); String formats[] = { "yyyy/M/d/H/m/s/S", "yyyy/M/d" }; Date timeRawDate = null; for (String format : formats) { SimpleDateFormat sdf = new SimpleDateFormat(format); try { timeRawDate = sdf.parse(timeString); } catch (java.text.ParseException jtpe) { } if (timeRawDate != null) break; } return timeRawDate; }  String getJson(); @Override SimpleSystem connect(String... connectionParams); @Override SimpleNode moveTo(String nodeQuery, String... keys); String getActionJson(String action, String param, String actionQuery); static String getPatternMatchGroup(String regex, String toMatch,
      int groupIndex); static String getConcept(String askQuery); SimpleNode conceptAlizePrintRequests(String concept,
      JsonSystem askJson); static Date getTime(String timeString); @SuppressWarnings("rawtypes") void putValue(Vertex node, String key,
      Map<String, Object> conceptMap); static String fixAsk(String ask);  }### Answer:
@Test public void testTimeFormat() throws ParseException { long timestamps[] = { 1432315920, 1519171200 }; String timeraws[] = { "1/2015/5/22/17/32/0/0", "1/2018/2/21" }; String expected[] = { "2015-05-22 17:32:00", "2018-02-21 00:00:00" }; for (int i = 0; i < timeraws.length; i++) { long timestamp = timestamps[i] * 1000; Date timeRawDate = SmwSystem.getTime(timeraws[i]); Date timeStampDate = new Date(timestamp); SimpleDateFormat isoDate = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); assertEquals(expected[i], isoDate.format(timeRawDate)); if (debug) { System.out.println((timestamp - timeRawDate.getTime())); System.out.println(isoDate.format(timeStampDate)); System.out.println(isoDate.format(timeRawDate)); } } }