### Question:
JmsConsumerInfo extends JmsAbstractResource implements Comparable<JmsConsumerInfo> { public JmsConsumerInfo copy() { JmsConsumerInfo info = new JmsConsumerInfo(consumerId, dispatcher); copy(info); return info; } JmsConsumerInfo(JmsConsumerId consumerId, JmsMessageDispatcher dispatcher); JmsConsumerInfo copy(); @Override JmsConsumerId getId(); boolean isBrowser(); void setBrowser(boolean browser); boolean isListener(); void setListener(boolean listener); JmsDestination getDestination(); void setDestination(JmsDestination destination); int getPrefetchSize(); void setPrefetchSize(int prefetchSize); String getSelector(); void setSelector(String selector); boolean isExplicitClientID(); void setExplicitClientID(boolean explicitClientID); boolean isDurable(); void setDurable(boolean durable); String getSubscriptionName(); void setSubscriptionName(String durableSubscriptionId); boolean isShared(); void setShared(boolean shared); boolean isNoLocal(); void setNoLocal(boolean noLocal); void setLastDeliveredSequenceId(long lastDeliveredSequenceId); long getLastDeliveredSequenceId(); JmsSessionId getParentId(); int getAcknowledgementMode(); void setAcknowledgementMode(int acknowledgementMode); boolean isLocalMessageExpiry(); void setLocalMessageExpiry(boolean localMessageExpiry); JmsRedeliveryPolicy getRedeliveryPolicy(); void setRedeliveryPolicy(JmsRedeliveryPolicy redeliveryPolicy); JmsDeserializationPolicy getDeserializationPolicy(); void setDeserializationPolicy(JmsDeserializationPolicy deserializationPolicy); boolean isPresettle(); void setPresettle(boolean presettle); boolean isConnectionConsumer(); void setConnectionConsumer(boolean connectionConsumer); int getMaxMessages(); void setMaxMessages(int maxMessages); JmsMessageDispatcher getDispatcher(); @Override String toString(); @Override int hashCode(); @Override boolean equals(Object obj); @Override int compareTo(JmsConsumerInfo other); @Override void visit(JmsResourceVistor vistor);  }### Answer:
@Test public void testCopy() { JmsConsumerInfo info = new JmsConsumerInfo(firstId, null); info.setAcknowledgementMode(1); info.setBrowser(true); info.setExplicitClientID(true); info.setDestination(new JmsTopic("Test")); info.setLastDeliveredSequenceId(42); info.setNoLocal(true); info.setPrefetchSize(123456); info.setSelector("select"); info.setDurable(true); info.setShared(true); info.setSubscriptionName("name"); info.setRedeliveryPolicy(new JmsDefaultRedeliveryPolicy()); info.setListener(true); JmsConsumerInfo copy = info.copy(); assertEquals(1, copy.getAcknowledgementMode()); assertEquals(true, copy.isBrowser()); assertEquals(true, copy.isExplicitClientID()); assertEquals(new JmsTopic("Test"), copy.getDestination()); assertEquals(42, copy.getLastDeliveredSequenceId()); assertEquals(true, copy.isNoLocal()); assertEquals(true, copy.isDurable()); assertEquals(true, copy.isShared()); assertEquals(123456, copy.getPrefetchSize()); assertEquals("select", copy.getSelector()); assertEquals("name", copy.getSubscriptionName()); assertEquals(true, copy.isListener()); assertNotSame(info.getRedeliveryPolicy(), copy.getRedeliveryPolicy()); assertEquals(info, copy); }