public void fillTreeForStub(@NotNull PsiFileWithStubSupport file, @NotNull StubTree tree) {
    StubBuilder builder = file instanceof PsiFileImpl ? getStubBuilder(((PsiFileImpl)file)) : null;
    if (builder == null) return;

    final Iterator<StubElement<?>> stubs = tree.getPlainList().iterator();
    final StubElement<?> root = stubs.next();
    final ASTNode ast = file.getNode();
    myNodeToStubs.put(ast, root);

    findTreeForStub(builder, ast, stubs);

    if (stubs.hasNext()) {
      LOG.error("Stub mismatch, unprocessed stubs " + stubs.next());
    }
  }
public void fillTreeForStub(@NotNull PsiFileWithStubSupport file, @NotNull StubTree tree)