AmqpTarget implements PublishTarget { static AmqpTarget fromTargetAddress(final String targetAddress) { ConditionChecker.argumentNotEmpty(targetAddress, "targetAddress"); final Destination destination; if (targetAddress.startsWith(TOPIC_PREFIX)) { destination = new JmsTopic(targetAddress.replace(TOPIC_PREFIX, EMPTY_STRING)); } else if (targetAddress.startsWith(QUEUE_PREFIX)) { destination = new JmsQueue(targetAddress.replace(QUEUE_PREFIX, EMPTY_STRING)); } else { destination = new JmsQueue(targetAddress); } return new AmqpTarget(destination); } private  AmqpTarget(final Destination jmsDestination); @Override boolean equals(final Object o); @Override int hashCode(); @Override String toString();  }
@Test(expected = NullPointerException.class) public void testNull() { AmqpTarget.fromTargetAddress(null); }
@Test(expected = IllegalArgumentException.class) public void testEmpty() { AmqpTarget.fromTargetAddress(""); }