### Question:
JmsConnectionId extends JmsAbstractResourceId implements Comparable<JmsConnectionId> { public String getValue() { return value; } JmsConnectionId(String connectionId);  JmsConnectionId(JmsConnectionId id);  JmsConnectionId(JmsSessionId id);  JmsConnectionId(JmsProducerId id);  JmsConnectionId(JmsConsumerId id); String getValue(); @Override int hashCode(); @Override boolean equals(Object o); @Override String toString(); @Override int compareTo(JmsConnectionId o);  }### Answer:
@Test public void testStringConstructor() { JmsConnectionId id = new JmsConnectionId(firstId); assertNotNull(id.getValue()); assertNull(id.getProviderHint()); }
@Test public void testProviderHints() { JmsConnectionId id = new JmsConnectionId(firstId); assertNotNull(id.getValue()); assertNull(id.getProviderHint()); String hint = new String("hint"); id.setProviderHint(hint); assertEquals(hint, id.getProviderHint()); }
@Test public void testJmsConnectionIdFromJmsConnectionId() throws Exception { JmsConnectionId id1 = new JmsConnectionId(firstId); JmsConnectionId id2 = new JmsConnectionId(id1); assertSame(id1.getValue(), id2.getValue()); }
@Test public void testJmsConnectionIdFromJmsSessionId() throws Exception { JmsConnectionId id1 = new JmsConnectionId(firstId); JmsSessionId sessionId = new JmsSessionId(id1, 1); JmsConnectionId id2 = new JmsConnectionId(sessionId); assertSame(id1.getValue(), id2.getValue()); }
@Test public void testJmsConnectionIdFromJmsConsumerId() throws Exception { JmsConnectionId id1 = new JmsConnectionId(firstId); JmsSessionId sessionId = new JmsSessionId(id1, 1); JmsConsumerId consumerId = new JmsConsumerId(sessionId, 1); JmsConnectionId id2 = new JmsConnectionId(consumerId); assertSame(id1.getValue(), id2.getValue()); }
@Test public void testJmsConnectionIdFromJmsProducerId() throws Exception { JmsConnectionId id1 = new JmsConnectionId(firstId); JmsSessionId sessionId = new JmsSessionId(id1, 1); JmsProducerId consumerId = new JmsProducerId(sessionId, 1); JmsConnectionId id2 = new JmsConnectionId(consumerId); assertSame(id1.getValue(), id2.getValue()); }