void (@NotNull Editor editor, @NotNull LightweightHint hint, int flags, @NotNull HintHint hintInfo) { visibleHints.add(hint); hint.addHintListener(new HintListener() { @Override public void hintHidden(@NotNull EventObject event) { visibleHints.remove(hint); hint.removeHintListener(this); } }); }