public void testEquals() throws Exception
{
String destinationName = RandomUtil.randomString();
String address = HornetQDestination.JMS_QUEUE_ADDRESS_PREFIX + destinationName;
HornetQDestination destination = (HornetQDestination) HornetQDestination.fromAddress(address);
HornetQDestination sameDestination = (HornetQDestination) HornetQDestination.fromAddress(address);
HornetQDestination differentDestination = (HornetQDestination) HornetQDestination.fromAddress(address + RandomUtil.randomString());
Assert.assertFalse(destination.equals(null));
Assert.assertTrue(destination.equals(destination));
Assert.assertTrue(destination.equals(sameDestination));
Assert.assertFalse(destination.equals(differentDestination));