private static Collection<StubIndexKey> getAffectedIndices(
     final Map<StubIndexKey, Map<Object, TIntArrayList>> oldStubTree,
     final Map<StubIndexKey, Map<Object, TIntArrayList>> newStubTree) {
   Set<StubIndexKey> allIndices = new HashSet<StubIndexKey>();
   allIndices.addAll(oldStubTree.keySet());
   allIndices.addAll(newStubTree.keySet());
   return allIndices;
 }
 @NotNull
 private static Collection<StubIndexKey> getAffectedIndices(
     @NotNull final Map<StubIndexKey, Map<Object, int[]>> oldStubTree,
     @NotNull final Map<StubIndexKey, Map<Object, int[]>> newStubTree) {
   Set<StubIndexKey> allIndices = new HashSet<StubIndexKey>();
   allIndices.addAll(oldStubTree.keySet());
   allIndices.addAll(newStubTree.keySet());
   return allIndices;
 }
  private void dropUnregisteredIndices() {
    final Set<String> indicesToDrop =
        new HashSet<String>(
            myPreviouslyRegistered != null
                ? myPreviouslyRegistered.registeredIndices
                : Collections.<String>emptyList());
    for (ID<?, ?> key : myIndices.keySet()) {
      indicesToDrop.remove(key.toString());
    }

    for (String s : indicesToDrop) {
      FileUtil.delete(IndexInfrastructure.getIndexRootDir(ID.create(s)));
    }
  }