void (@NotNull final List<Trinity<PsiModifierListOwner, String, Boolean>> expectedSequence) { myBusConnection = myFixture.getProject().getMessageBus().connect(); myBusConnection.subscribe(ExternalAnnotationsManager.TOPIC, new DefaultAnnotationsListener() { private int index; @Override public void afterExternalAnnotationChanging(@NotNull PsiModifierListOwner owner, @NotNull String annotationFQName, boolean successful) { if (index < expectedSequence.size() && expectedSequence.get(index).first == owner && expectedSequence.get(index).second.equals(annotationFQName) && expectedSequence.get(index).third == successful) { index++; myExpectedEventWasProduced = true; } else { super.afterExternalAnnotationChanging(owner, annotationFQName, successful); } } }); }