void (PsiJavaModule javaModule) { for (PsiUsesStatement statement : javaModule.getUses()) { final PsiJavaCodeReferenceElement reference = statement.getClassReference(); if (reference != null) { final PsiElement usedInterface = reference.resolve(); if (usedInterface instanceof PsiClass) { final RefElement refClass = getRefManager().getReference(usedInterface); if (refClass instanceof RefClass) { if (myUsedServices == null) { myUsedServices = new HashSet<>(); } myUsedServices.add((RefClass)refClass); } } } } }