void (PsiReference reference, String... variants) { Object[] refVariants = reference.getVariants(); assertNotNull(refVariants); assertEquals(refVariants.length, variants.length); int i = 0; for (String variant : variants) { Object refVariant = refVariants[i++]; if (refVariant instanceof LookupElement) { assertEquals(variant, ((LookupElement)refVariant).getLookupString()); } else if (refVariant instanceof PresentableLookupValue) { assertEquals(variant, ((PresentableLookupValue)refVariant).getPresentation()); } else { assertEquals(variant, refVariant.toString()); } } }