boolean (@Nullable final LookupElement item, char completionChar) { boolean result = true; if (!myListeners.isEmpty()){ LookupEvent event = new LookupEvent(this, item, completionChar); for (LookupListener listener : myListeners) { try { if (!listener.beforeItemSelected(event)) result = false; } catch (Throwable e) { LOG.error(e); } } } return result; }