@Override public Destination getDestination( JmsDelegate meta ) {
    checkNotNull( meta.destinationName, getString( JmsConstants.PKG, "JmsWebsphereMQ.DestinationNameRequired" ) );
    try {
      String destName = meta.destinationName;
      return isQueue( meta )
        ? new MQQueue( destName )
        : new MQTopic( destName );
    } catch ( JMSException e ) {
      throw new IllegalStateException( e );
    }
  }
@Test
  public void noDestinationNameSetCausesError() {
    jmsDelegate.destinationType = QUEUE.name();
    jmsDelegate.destinationName = null;

    try {
      jmsProvider.getDestination( jmsDelegate );
      fail();
    } catch ( Exception e ) {
      assertTrue( e.getMessage().contains( "Destination name must be set." ) );
    }
  }