private static boolean canBeImported(@NotNull PsiClass aClass) {
    while (true) {
      if (aClass.hasModifierProperty(PsiModifier.PRIVATE)) {
        return false;
      }
      PsiElement parent = aClass.getParent();
      if (parent == null || parent instanceof PsiDeclarationStatement) {
        return false;
      }
      if (parent instanceof PsiJavaFile) {
        return true;
      }
      if (!(parent instanceof PsiClass)) {
        return false;
      }
      aClass = (PsiClass)parent;
    }
  }
private static boolean canBeImported(@NotNull PsiClass aClass)