@Test public void testImmutableDate() { Date now = new Date(); StopTransactionCommand command = new StopTransactionCommand(CHARGING_STATION_ID, TRANSACTION_ID, IDENTIFYING_TOKEN, TRANSACTION_NUMBER, now, NULL_USER_IDENTITY_CONTEXT); command.getTimestamp().setTime(TWO_MINUTES_AGO.getTime()); assertEquals(now, command.getTimestamp()); }
public Date getTimestamp() { return new Date(timestamp.getTime()); }
StopTransactionCommand { public Date getTimestamp() { return new Date(timestamp.getTime()); } }
StopTransactionCommand { public Date getTimestamp() { return new Date(timestamp.getTime()); } StopTransactionCommand(ChargingStationId chargingStationId, TransactionId transactionId, IdentifyingToken identifyingToken, int meterStop, Date timestamp, IdentityContext identityContext); }
StopTransactionCommand { public Date getTimestamp() { return new Date(timestamp.getTime()); } StopTransactionCommand(ChargingStationId chargingStationId, TransactionId transactionId, IdentifyingToken identifyingToken, int meterStop, Date timestamp, IdentityContext identityContext); ChargingStationId getChargingStationId(); TransactionId getTransactionId(); IdentifyingToken getIdTag(); int getMeterStop(); Date getTimestamp(); IdentityContext getIdentityContext(); @Override int hashCode(); @Override boolean equals(Object obj); }
StopTransactionCommand { public Date getTimestamp() { return new Date(timestamp.getTime()); } StopTransactionCommand(ChargingStationId chargingStationId, TransactionId transactionId, IdentifyingToken identifyingToken, int meterStop, Date timestamp, IdentityContext identityContext); ChargingStationId getChargingStationId(); TransactionId getTransactionId(); IdentifyingToken getIdTag(); int getMeterStop(); Date getTimestamp(); IdentityContext getIdentityContext(); @Override int hashCode(); @Override boolean equals(Object obj);  }