### Question:
CellarSupport { public Boolean isAllowed(Group group, String category, String event, EventType type) { Set<String> whiteList = getListEntries(Configurations.WHITELIST, group, category, type); Set<String> blackList = getListEntries(Configurations.BLACKLIST, group, category, type); if (blackList == null || whiteList == null) { LOGGER.warn("No whitelist/blacklist found for " + group.getName() + ", check your configuration !"); return false; } Boolean result = true; if (!whiteList.isEmpty()) { result = false; for (String whiteListItem : whiteList) { if (wildCardMatch(event, whiteListItem)) { result = true; break; } } } if (result) { for (String blackListItem : blackList) { if (wildCardMatch(event, blackListItem)) { return false; } } } return result; }  void switchListEntry(String listType, String group, String category, EventType type, String entry); Set<String> getListEntries(String listType, String group, String category, EventType type); Set<String> getListEntries(String listType, Collection<String> groups, String category, EventType type); Set<String> getListEntries(String listType, Group group, String category, EventType type); Boolean isAllowed(Group group, String category, String event, EventType type); ConfigurationAdmin getConfigurationAdmin(); void setConfigurationAdmin(ConfigurationAdmin configurationAdmin); ClusterManager getClusterManager(); void setClusterManager(ClusterManager clusterManager); GroupManager getGroupManager(); void setGroupManager(GroupManager groupManager);  }### Answer:
@Test public void testIsAllowed() { CellarSupport support = new CellarSupport(); support.setConfigurationAdmin(configurationAdmin); Boolean expectedResult = false; Boolean result = support.isAllowed(defaultGroup,"config","org.apache.karaf.shell", EventType.INBOUND); assertEquals("Shell should not be allowed",expectedResult,result); expectedResult = true; result = support.isAllowed(defaultGroup,"config","org.apache.karaf.cellar.group", EventType.INBOUND); assertEquals("Group config should be allowed",expectedResult,result); expectedResult = false; result = support.isAllowed(defaultGroup,"config","org.apache.karaf.cellar.node", EventType.INBOUND); assertEquals("Node config should be allowed",expectedResult,result); expectedResult = false; result = support.isAllowed(defaultGroup,"config","org.apache.karaf.cellar.instance", EventType.INBOUND); assertEquals("Instance config should be allowed",expectedResult,result); }