void (@NotNull PsiReferenceRegistrar registrar) { registrar.registerReferenceProvider( getElementPattern(GROUP_CLASSES, "groups"), new PsiReferenceProvider() { @Override public PsiReference @NotNull [] getReferencesByElement(@NotNull PsiElement element, @NotNull final ProcessingContext context) { return new GroupReference[]{new GroupReference(element.getProject(), (PsiLiteral)element)}; } }); registrar.registerReferenceProvider( getElementPattern(GROUP_CLASSES, "dependsOnMethods"), new PsiReferenceProvider() { @Override public PsiReference @NotNull [] getReferencesByElement(@NotNull PsiElement element, @NotNull final ProcessingContext context) { return new MethodReference[]{new MethodReference((PsiLiteral)element)}; } }); registrar.registerReferenceProvider( getElementPattern(GROUP_CLASSES, "dependsOnGroups"), new PsiReferenceProvider() { @Override public PsiReference @NotNull [] getReferencesByElement(@NotNull PsiElement element, @NotNull final ProcessingContext context) { return new GroupReference[]{new GroupReference(element.getProject(), (PsiLiteral)element)}; } }); registrar.registerReferenceProvider( getElementPattern(List.of(ORG_TESTNG_ANNOTATIONS_TEST, ORG_TESTNG_ANNOTATIONS_FACTORY), "dataProvider"), new PsiReferenceProvider() { @Override public PsiReference @NotNull [] getReferencesByElement(@NotNull PsiElement element, @NotNull final ProcessingContext context) { return new DataProviderReference[]{new DataProviderReference((PsiLiteral)element)}; } }); }