@Test public void messagePeer() throws Exception
{
//create an anonymous concrete node class
TestNode receiver = new TestNode();
TestNode sender = new TestNode();
GameStateMessage m = new GameStateMessage(0, 0.0, sender, 0, 0);
alr.messagePeer(receiver, m);
//check that it is the same message
GameStateMessage r = (GameStateMessage)receiver.getMessage();
assertEquals(r, m);
//check that the sender is the same
assertEquals(sender, r.getSender());
//check that the delay was increased
assertEquals(1, r.getDelay());
//repeat
alr.messagePeer(receiver, m);
r = (GameStateMessage)receiver.getMessage();
assertEquals(r, m);
assertEquals(2, r.getDelay());
}