ConsumerContainer { protected List<ConsumerHolder> filterConsumersForActiveFlag(boolean active) { List<ConsumerHolder> consumerHolderSubList = new LinkedList<ConsumerHolder>(); for (ConsumerHolder consumerHolder : consumerHolders) { if (consumerHolder.isActive() == active) { consumerHolderSubList.add(consumerHolder); } } return consumerHolderSubList; } ConsumerContainer(ConnectionFactory connectionFactory); void addConsumer(Consumer consumer, String queue); void addConsumer(Consumer consumer, String queue, boolean autoAck); void addConsumer(Consumer consumer, String queue, int prefetchMessageCount, int instances); void addConsumer(Consumer consumer, String queue, int instances); void addConsumer(Consumer consumer, String queue, boolean autoAck, int prefetchMessageCount, int instances); void addConsumer(Consumer consumer, String queue, boolean autoAck, int instances); synchronized void addConsumer(Consumer consumer, ConsumerConfiguration configuration, int instances); synchronized void startConsumers(Class<? extends Consumer> consumerClass); synchronized void startAllConsumers(); synchronized void stopConsumers(Class<? extends Consumer> consumerClass); synchronized void stopAllConsumers(); synchronized void reset(); List<ConsumerHolder> getEnabledConsumers(); List<ConsumerHolder> getDisabledConsumers(); List<ConsumerHolder> getActiveConsumers(); List<ConsumerHolder> getInactiveConsumers();  }
@Test public void testFilterConsumersForActiveFlag() { List<ConsumerContainer.ConsumerHolder> consumerHolderList = consumerContainer.consumerHolders; consumerHolderList.get(0).active = true; consumerHolderList.get(1).active = false; int activeConsumerHolderSize = consumerContainer.filterConsumersForActiveFlag(true).size(); Assert.assertEquals(1, activeConsumerHolderSize); int inactiveConsumerHolderSize = consumerContainer.filterConsumersForActiveFlag(false).size(); Assert.assertEquals(1, inactiveConsumerHolderSize); }