List<String> (CodeInsightTestFixture fixture, Function<? super LookupElement, String> lookupElementStringFunction) { LookupElement[] variants = fixture.getLookupElements(); if (variants == null) return null; List<String> result = new ArrayList<>(); for (LookupElement each : variants) { result.add(lookupElementStringFunction.apply(each)); } return result; }