### Question:
JmsQueue extends JmsDestination implements Queue { @Override public String getQueueName() { return getAddress(); } JmsQueue();  JmsQueue(String name); @Override String getQueueName();  }### Answer:
@Test public void testSetPropertiesWithUnusedOptions() throws Exception { String name = "myQueue"; String unusedKey = "unusedKey"; String unusedValue = "unusedValue"; JmsQueue queue = new JmsQueue(); Map<String, String> props = new HashMap<String, String>(); props.put(NAME_PROP, name); props.put(unusedKey, unusedValue); Map<String, String> unusedProps = queue.setProperties(props); assertEquals("Unexpected value for name", name, queue.getQueueName()); assertEquals("Unexpected size of return map", 1, unusedProps.size()); assertTrue("Expected property not found in map: " + unusedProps, unusedProps.containsKey(unusedKey)); assertEquals("Unexpected property value", unusedValue, unusedProps.get(unusedKey)); try { unusedProps.put("a", "b"); fail("Map should be unmodifiable"); } catch (UnsupportedOperationException uoe) { } }
@Test public void testSerializeThenDeserialize() throws Exception { String name = "myQueue"; JmsQueue queue = new JmsQueue(name); Object roundTripped = roundTripSerialize(queue); assertNotNull("Null destination returned", roundTripped); assertEquals("Unexpected type", JmsQueue.class, roundTripped.getClass()); assertEquals("Unexpected name", name, ((JmsQueue)roundTripped).getQueueName()); assertEquals("Objects were not equal", queue, roundTripped); assertEquals("Object hashCodes were not equal", queue.hashCode(), roundTripped.hashCode()); }