Generate nonce and send the message in a synchronized block
Generate nonce before the message is created.
Add tests
remove call on System.out
fix a potential NPE
Merge branch 'rafalkrupinski-nonce' into develop