PrivilegeDefinitionReader implements PrivilegeConstants { @NotNull Map<String, PrivilegeDefinition> readDefinitions() { Map<String, PrivilegeDefinition> definitions = new HashMap<>(); for (Tree child : privilegesTree.getChildren()) { if (isPrivilegeDefinition(child)) { PrivilegeDefinition def = PrivilegeUtil.readDefinition(child); definitions.put(def.getName(), def); } } return definitions; } PrivilegeDefinitionReader(@NotNull Root root);   }
@Test public void testReadDefinitionsIgnoresInvalid() { assertFalse(reader.readDefinitions().containsKey("invalid")); }