MockObserver observer=new MockObserver();
encrypt.setObserver(observer);
encrypt.keyServer=true;
String messageText="hello this is a test message";
Message msg=new Message(null, null, messageText.getBytes());
Event event=new Event(Event.MSG, msg);
encrypt.down(event);
Message sentMsg=(Message)((Event)observer.getDownMessages().get("message0")).getArg();
String encText=new String(sentMsg.getBuffer());
assert !encText.equals(messageText);
Cipher cipher=encrypt2.getSymDecodingCipher();
byte[] decodedBytes=cipher.doFinal(sentMsg.getBuffer());
String temp=new String(decodedBytes);
System.out.println("decoded text:" + temp);
assert temp.equals(messageText);
}