IndexDefinitionBuilder { public IndexRule indexRule(String type) { IndexRule rule = rules.get(type); if (rule == null) { rule = new IndexRule(getOrCreateChild(indexRule, type), type); rules.put(type, rule); } return rule; } IndexDefinitionBuilder();  IndexDefinitionBuilder(NodeBuilder nodeBuilder);  IndexDefinitionBuilder(NodeBuilder nodeBuilder, boolean autoManageReindexFlag); IndexDefinitionBuilder evaluatePathRestrictions(); IndexDefinitionBuilder includedPaths(String... paths); IndexDefinitionBuilder excludedPaths(String... paths); IndexDefinitionBuilder queryPaths(String... paths); IndexDefinitionBuilder supersedes(String... paths); IndexDefinitionBuilder noAsync(); IndexDefinitionBuilder deprecated(); IndexDefinitionBuilder async(String... asyncVals); IndexDefinitionBuilder tags(String... tagVals); IndexDefinitionBuilder codec(String codecName); IndexDefinitionBuilder mergePolicy(String mergePolicy); IndexDefinitionBuilder addTags(String... additionalTagVals); IndexDefinitionBuilder nodeTypeIndex(); Tree getBuilderTree(); NodeState build(); Tree build(Tree tree); Node build(Node node); boolean isReindexRequired(); IndexRule indexRule(String type); boolean hasIndexRule(String type); AggregateRule aggregateRule(String type); AggregateRule aggregateRule(String primaryType, String... includes);  }
@Test public void indexRule() throws Exception{ builder.includedPaths("/a", "/b"); builder.queryPaths("/c", "/d"); builder.supersedes("/e", "/f"); builder.indexRule("nt:base") .property("foo") .ordered() .enclosingRule() .property("bar") .analyzed() .propertyIndex() .enclosingRule() .property("baz") .propertyIndex(); NodeState state = builder.build(); assertTrue(state.getChildNode("indexRules").exists()); assertTrue(state.getChildNode("indexRules").getChildNode("nt:base").exists()); assertEquals(asList("/a", "/b"), state.getProperty(PathFilter.PROP_INCLUDED_PATHS).getValue(Type.STRINGS)); assertEquals(asList("/c", "/d"), state.getProperty(IndexConstants.QUERY_PATHS).getValue(Type.STRINGS)); assertEquals(asList("/e", "/f"), state.getProperty(IndexConstants.SUPERSEDED_INDEX_PATHS).getValue(Type.STRINGS)); }