when(amqpPort.getContextValue(eq(Integer.class), eq(AmqpPort.PORT_MAX_MESSAGE_SIZE))).thenReturn(AmqpPort.DEFAULT_MAX_MESSAGE_SIZE);
ServerConnection connection = new ServerConnection(1, broker, amqpPort, Transport.TCP);
connection.setVirtualHost(_virtualHost);
ServerSession session1 = new ServerSession(connection, new ServerSessionDelegate(),
new Binary(getName().getBytes()), 0);
// create a session with the same name but on a different connection
ServerConnection connection2 = new ServerConnection(2, broker, amqpPort, Transport.TCP);
connection2.setVirtualHost(_virtualHost);
ServerSession session2 = new ServerSession(connection2, new ServerSessionDelegate(),
new Binary(getName().getBytes()), 0);
assertFalse("Unexpected compare result", session1.compareTo(session2) == 0);
assertEquals("Unexpected compare result", 0, session1.compareTo(session1));
}