@Contract("null, _ -> null; !null, null -> null")
  public static @Nullable LanguageLevel getVersionForVersionRoot(@Nullable VirtualFile root, @Nullable VirtualFile directory) {
    if (root == null || directory == null) return null;
    VirtualFile parent = directory.getParent();
    if (parent == null) return null;
    if (parent.getName().equals("versions")) {
      VirtualFile grandParent = parent.getParent();
      if (grandParent != null && grandParent.getName().equals("META-INF") && root.equals(grandParent.getParent())) {
        try {
          LanguageLevel level = LanguageLevel.forFeature(Integer.parseInt(directory.getName()));
          return level != null && level.isAtLeast(MIN_MULTI_RELEASE_VERSION) ? level : null;
        }
        catch (NumberFormatException ignored) {
        }
      }
    }
    return null;
  }
@Contract("null, _ -> null; !null, null -> null")
  public static @Nullable LanguageLevel getVersionForVersionRoot(@Nullable VirtualFile root, @Nullable VirtualFile directory)