### Question:
SimpleCollector { boolean isTurnedOff(String consumerName, String lifecycle, String propertyPrefix) { String lifecycleProp = System.getProperty(propertyPrefix + "." + lifecycle); String consumerProp = System.getProperty(propertyPrefix + "." + lifecycle + "." + consumerName ); if (consumerProp != null && !Boolean.parseBoolean(consumerProp)) return true; if (consumerProp == null && lifecycleProp != null && !Boolean.parseBoolean(lifecycleProp)) return true; return false; } 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 testPropsShutoff() { SimpleCollector ddc = new SimpleCollector(); assertFalse(ddc.isTurnedOff("queue", "pending", "testpropoff")); System.setProperty("testpropoff.pending", "false"); assertTrue(ddc.isTurnedOff("queue", "pending", "testpropoff")); assertFalse(ddc.isTurnedOff("queue", "validate", "testpropoff")); System.setProperty("testpropoff.validate", "true"); assertFalse(ddc.isTurnedOff("queue", "validate", "testpropoff")); System.setProperty("testpropoff.validate", "hellyeah"); assertTrue(ddc.isTurnedOff("queue", "validate", "testpropoff")); }