private static boolean areGenericsAvailable(@Nullable PsiFile file){
      return file instanceof AbstractBasicJavaFile &&
             JavaFeature.GENERICS.isSufficient(AbstractBasicJavaDefinitionService.getJavaDefinitionService().getLanguageLevel(file));
  }
private static boolean areGenericsAvailable(@Nullable PsiFile file)