private static boolean isFromDefaultPackage(@Nullable PsiElement element) {
    if (element instanceof PsiClass) {
      String qname = ((PsiClass)element).getQualifiedName();
      if (qname != null) {
        String packageName = StringUtil.getPackageName(qname);
        if (ArrayUtil.contains(packageName, GroovyFileBase.IMPLICITLY_IMPORTED_PACKAGES)) {
          return true;
        }
        if (ArrayUtil.contains(qname, GroovyFileBase.IMPLICITLY_IMPORTED_CLASSES)) {
          return true;
        }
      }
    }

    return false;
  }
private static boolean isFromDefaultPackage(@Nullable PsiElement element)