private static @NotNull JavaParserUtil.ParserWrapper getParserWrapper(@Nullable PsiElement context) {
    if (context instanceof PsiImportStaticStatement && !((PsiImportStaticStatement)context).isOnDemand()) {
      return STATIC_IMPORT_REF;
    }
    else if (context instanceof PsiImportModuleStatement) {
      return MODULE_IMPORT_REF;
    }
    else if (context instanceof PsiNewExpression && PsiUtil.isAvailable(JavaFeature.DIAMOND_TYPES, context)) {
      return DIAMOND_REF;
    }
    else {
      return REFERENCE;
    }
  }
private static @NotNull JavaParserUtil.ParserWrapper getParserWrapper(@Nullable PsiElement context)