StreamFactory { public static Long getReferenceEffectiveTime(final Map<String, String> argsMap, boolean doDefault) { Long effectiveMs = getSafeMs(argsMap, StandardHeaderArguments.EFFECTIVE_TIME); if (effectiveMs != null) { return effectiveMs; } effectiveMs = getSafeMs(argsMap, PERIOD_START_TIME); if (effectiveMs != null) { return effectiveMs; } if (doDefault) { return System.currentTimeMillis(); } return null; } private  StreamFactory(); static Long getReferenceEffectiveTime(final Map<String, String> argsMap, boolean doDefault); static Long getReceivedTime(final Map<String, String> argsMap, boolean doDefault);  }
@Test void testSimple() { final String testDate = "2000-01-01T00:00:00.000Z"; final AttributeMap attributeMap = new AttributeMap(); attributeMap.put("effectivetime", testDate); final Long time = StreamFactory.getReferenceEffectiveTime(attributeMap, true); assertThat(DateUtil.createNormalDateTimeString(time)).isEqualTo(testDate); }