private static @Nullable VirtualFile getFile(@NotNull Object node) {
    if (!(((DefaultMutableTreeNode)node).getUserObject() instanceof FileNodeDescriptor descriptor)) return null;
    if (descriptor.getElement().getFile() == null) return null;
    return descriptor.getElement().getFile();
  }
private static @Nullable VirtualFile getFile(@NotNull Object node)