@Test public void testImmutableDate() { Date now = new Date(); StatusNotification statusNotification = new StatusNotification(ComponentStatus.AVAILABLE, now, Collections.<String, String>emptyMap()); statusNotification.getTimeStamp().setTime(ChargingStationTestUtils.TWO_MINUTES_AGO.getTime()); assertEquals(now, statusNotification.getTimeStamp()); }
public Date getTimeStamp() { return new Date(timeStamp.getTime()); }
StatusNotification { public Date getTimeStamp() { return new Date(timeStamp.getTime()); } }
StatusNotification { public Date getTimeStamp() { return new Date(timeStamp.getTime()); } StatusNotification(ComponentStatus status, Date timeStamp, Map<String, String> attributes); }
StatusNotification { public Date getTimeStamp() { return new Date(timeStamp.getTime()); } StatusNotification(ComponentStatus status, Date timeStamp, Map<String, String> attributes); ComponentStatus getStatus(); Date getTimeStamp(); Map<String, String> getAttributes(); @Override int hashCode(); @Override boolean equals(Object obj); @Override String toString(); }
StatusNotification { public Date getTimeStamp() { return new Date(timeStamp.getTime()); } StatusNotification(ComponentStatus status, Date timeStamp, Map<String, String> attributes); ComponentStatus getStatus(); Date getTimeStamp(); Map<String, String> getAttributes(); @Override int hashCode(); @Override boolean equals(Object obj); @Override String toString();  }