private static boolean canUseTypeInClassExpression(PsiTypeElement type) {
    return type != null && !PsiUtilCore.hasErrorElementChild(type) &&
           SyntaxTraverser.psiTraverser(type).filter(PsiReferenceParameterList.class)
             .find(list -> list.getTextLength() > 0) == null;
  }
private static boolean canUseTypeInClassExpression(PsiTypeElement type)