LookupElement[] (Expression @NotNull [] params, ExpressionContext context) { Object o = runIt(params, context); Collection collection = o instanceof Collection ? (Collection)o : o instanceof Object[] ? Arrays.asList((Object[])o) : ContainerUtil.createMaybeSingletonList(o); return ContainerUtil.map2Array(collection, LookupElement.class, item -> LookupElementBuilder.create(toNormalizedString(item))); }