void (@NotNull String rule) { myFixture.completeBasic(); LookupImpl lookup = (LookupImpl) myFixture.getLookup(); assertNotNull(lookup); lookup.getItems().stream() .filter(item -> item.getLookupString().equals(rule)) .findFirst().ifPresent(lookupElement -> { lookup.setCurrentItem(lookupElement); lookup.finishLookup(Lookup.NORMAL_SELECT_CHAR); }); }