boolean (@Nullable Sdk jdk, @NotNull LanguageLevel level) { if (jdk == null) return true; JavaSdkVersion version = JavaSdkVersionUtil.getJavaSdkVersion(jdk); JavaSdkVersion required = JavaSdkVersion.fromLanguageLevel(level); return version != null && (level.isPreview() ? version.equals(required) : version.isAtLeast(required)); }