void (final GutterMark gutterMark, final String tooltip, final Icon icon, final String... expectedTargets) { assertNotNull(gutterMark); assertEquals(tooltip, gutterMark.getTooltipText()); assertEquals(icon, gutterMark.getIcon()); final Collection<PsiElement> targetElements; if (gutterMark instanceof LineMarkerInfo.LineMarkerGutterIconRenderer) { final LineMarkerInfo.LineMarkerGutterIconRenderer renderer = UsefulTestCase.assertInstanceOf(gutterMark, LineMarkerInfo.LineMarkerGutterIconRenderer.class); final LineMarkerInfo lineMarkerInfo = renderer.getLineMarkerInfo(); GutterIconNavigationHandler handler = lineMarkerInfo.getNavigationHandler(); if (handler instanceof NavigationGutterIconRenderer) { targetElements = ((NavigationGutterIconRenderer)handler).getTargetElements(); } else { throw new IllegalArgumentException(handler + ": handler not supported"); } } else { throw new IllegalArgumentException(gutterMark.getClass() + ": gutter not supported"); } UsefulTestCase.assertSameElements(ContainerUtil.map(targetElements, element -> SymbolPresentationUtil.getSymbolPresentableText(element)), expectedTargets); }