UniqueEntryStoreStrategy implements IndexStoreStrategy { @Override public void update( Supplier<NodeBuilder> index, String path, @Nullable final String indexName, @Nullable final NodeBuilder indexMeta, Set<String> beforeKeys, Set<String> afterKeys) { for (String key : beforeKeys) { remove(index.get(), key, path); } for (String key : afterKeys) { insert(index.get(), key, path); } } UniqueEntryStoreStrategy();  UniqueEntryStoreStrategy(String indexName);  UniqueEntryStoreStrategy(String indexName, @NotNull Consumer<NodeBuilder> insertCallback); @Override void update(
            Supplier<NodeBuilder> index, String path,
            @Nullable final String indexName,
            @Nullable final NodeBuilder indexMeta,
            Set<String> beforeKeys, Set<String> afterKeys); @Override Iterable<String> query(final Filter filter, final String indexName, 
            final NodeState indexMeta, final Iterable<String> values); Iterable<IndexEntry> queryEntries(Filter filter, String indexName, NodeState indexMeta,
            Iterable<String> values); @Override boolean exists(Supplier<NodeBuilder> index, String key); @Override long count(NodeState root, NodeState indexMeta, Set<String> values, int max); @Override long count(final Filter filter, NodeState root, NodeState indexMeta, Set<String> values, int max); @Override String getIndexNodeName();  }
@Test public void callbackInvoked() throws Exception{ AtomicBoolean callbackInvoked = new AtomicBoolean(); store = new UniqueEntryStoreStrategy(INDEX_CONTENT_NODE_NAME, (nb) -> callbackInvoked.set(true)); indexName = "foo"; NodeState root = EMPTY_NODE; indexMeta = root.builder(); Supplier<NodeBuilder> index = memoize(() -> indexMeta.child(INDEX_CONTENT_NODE_NAME)); store.update(index, "/some/node1", null, null, EMPTY, newHashSet("key1")); assertTrue(callbackInvoked.get()); }