### Question:
SimpleCollector { static String getConsumerName(String consumerName) { String cn = consumerName; if (cn == null) return ""; int lio = consumerName.lastIndexOf(':'); if (lio > -1) cn = consumerName.substring(0, lio); return cn; } SimpleCollector(); @LifeCycle(value=ProcessStep.Pending) void pending(MessageRunnable mr); @LifeCycle(value=ProcessStep.Validating) void validating(MessageRunnable mr); @LifeCycle(value=ProcessStep.Invalid) void invalid(MessageRunnable mr); @LifeCycle(value=ProcessStep.Processing) void processing(MessageRunnable mr); @LifeCycle(value=ProcessStep.Complete) void complete(MessageRunnable mr); @LifeCycle(value=ProcessStep.Error) void error(MessageRunnable mr); @LifeCycle(value=ProcessStep.Retrying) void retry(MessageRunnable mr); @LifeCycle(value=ProcessStep.MaxRetriesExceeded) void maxRetries(MessageRunnable mr);  }### Answer:
@Test public void testQueueName() { assertEquals("queue", DatadogCollector.getConsumerName("queue:1")); assertEquals("queue:1", DatadogCollector.getConsumerName("queue:1:1")); assertEquals("queue", DatadogCollector.getConsumerName("queue")); assertEquals("", DatadogCollector.getConsumerName("")); assertEquals("", DatadogCollector.getConsumerName(":queuee1")); assertEquals("", DatadogCollector.getConsumerName(null)); }