void (JavaCodeInsightTestFixture fixture, String ... expectedVariants) { LookupElement[] lookupElements = fixture.completeBasic(); Assert.assertNotNull(lookupElements); Set<String> missedVariants = ContainerUtil.newHashSet(expectedVariants); for (LookupElement lookupElement : lookupElements) { String lookupString = lookupElement.getLookupString(); missedVariants.remove(lookupString); Object object = lookupElement.getObject(); if (object instanceof ResolveResult) { object = ((ResolveResult)object).getElement(); } if (object instanceof PsiMethod) { missedVariants.remove(lookupString + "()"); } else if (object instanceof PsiVariable) { missedVariants.remove('@' + lookupString); } else if (object instanceof NamedArgumentDescriptor) { missedVariants.remove(lookupString + ':'); } } if (missedVariants.size() > 0) { Assert.fail("Some completion variants are missed " + missedVariants); } }