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

      assertTrue(NATSMessageConsumptionTask.acceptEndpoint("nats://localhost:4222/testTopic"));

      assertTrue(NATSMessageConsumptionTask.acceptEndpoint("nats://mynats.acme.com/testTopic"));
   }