@Override
    protected String toHtmlDisplay(Element element, String query) {
        String label = element.getLabel();

        int index = label.toLowerCase().indexOf(query.toLowerCase());
        String before = label.substring(0, index);
        String match = label.substring(index, index + query.length());
        String after = label.substring(index + query.length());
        return NbBundle.getMessage(FuzzyElementLabelSearchProvider.class,
            "FuzzyElementLabelSearchProvider.result",
            before, match, after);
    }
@Test
    public void testHtmlFirst() {
        Mockito.when(node.getLabel()).thenReturn("foobar");
        Assert.assertTrue(
            new FuzzyElementLabelSearchProvider().toHtmlDisplay(node, "foo").contains("<b>foo</b>bar"));
    }