Envelope { public Timestamp getCreateDate() { return ( Timestamp ) createDate.clone(); } Envelope( MessageEntity message );  Envelope( final Message message, String targetPeerId, String recipient, int timeToLive,
                     Map<String, String> headers ); Message getMessage(); String getTargetPeerId(); String getRecipient(); int getTimeToLive(); boolean isSent(); void setSent( final boolean isSent ); Timestamp getCreateDate(); void setCreateDate( final Timestamp createDate ); Map<String, String> getHeaders();  }
@Test public void testConstructorWithMessageEntity() throws Exception { long ts = System.currentTimeMillis(); when( messageEntity.getCreateDate() ).thenReturn( ts ); envelope = new Envelope( messageEntity ); TestCase.assertEquals( envelope.getCreateDate(), new Timestamp( ts ) ); }