boolean (PsiJavaModule module, @NotNull PsiClass serviceClass) { for (PsiUsesStatement usesStatement : module.getUses()) { PsiClassType usedClass = usesStatement.getClassType(); if (usedClass != null && serviceClass.equals(usedClass.resolve())) { return false; } } return true; }