void (final String @NotNull ... desiredVariants) { final LookupElement[] lookupElements = myFixture.completeBasic(); final LookupEx lookup = myFixture.getLookup(); if (lookupElements != null && lookupElements.length > 1) { // More than one element returned, check directly because completion can't work in this case for (final LookupElement element : lookupElements) { final String suggestedString = element.getLookupString(); if (Arrays.asList(desiredVariants).contains(suggestedString)) { myFixture.getLookup().setCurrentItem(element); lookup.setCurrentItem(element); myFixture.completeBasicAllCarets('\t'); return; } } } }