private static String getFileExtension(PsiFile file) {
    if (file instanceof PsiClassOwner) {
      for (final PsiClass psiClass : ((PsiClassOwner)file).getClasses()) {
        if (!isSynthetic(psiClass)) {
          return file.getViewProvider().getVirtualFile().getExtension();
        }
      }
    }
    return "";
  }
private static String getFileExtension(PsiFile file)