public static boolean acceptEndpoint(String endpointUrl) {
      return endpointUrl != null && endpointUrl.matches(ENDPOINT_PATTERN_STRING);
   }
@Test
   public void testAcceptEndpoint() {
      AsyncTestSpecification specification = new AsyncTestSpecification();
      MQTTMessageConsumptionTask task = new MQTTMessageConsumptionTask(specification);

      assertTrue(MQTTMessageConsumptionTask.acceptEndpoint("mqtt://localhost/testTopic"));

      assertTrue(MQTTMessageConsumptionTask.acceptEndpoint("mqtt://localhost:1883/testTopic"));

      assertTrue(MQTTMessageConsumptionTask.acceptEndpoint("mqtt://localhost:1883/topic/with/path/elements"));

      assertTrue(
            MQTTMessageConsumptionTask.acceptEndpoint("mqtt://localhost:1883/topic/with/path/elements?option1=value1"));

      assertTrue(MQTTMessageConsumptionTask.acceptEndpoint("mqtt://localhost/testTopic/option1=value1"));

      assertTrue(MQTTMessageConsumptionTask.acceptEndpoint("mqtt://localhost:1883/testTopic/option1=value1"));

      assertTrue(MQTTMessageConsumptionTask.acceptEndpoint(
            "mqtt://my-cluster-activemq.apps.cluster-943b.943b.example.com:1883/testTopic/option1=value1"));
   }