assertThat(filter.isElementVisible(v, path.getLastSegment()), is(FALSE));
}
@Test
public void shouldShowTheElementIfTheLabelOfTheElementMatchesTheFilterText() {
TreePath path = new TreePath(new Object[]{"parent", "child"});
ITreePathContentProvider contentProvider = mock(ITreePathContentProvider.class);
given(contentProvider.getChildren(path.getParentPath()))
.willReturn(new Object[]{path.getLastSegment()});
given(contentProvider.getParents(path.getLastSegment()))
.willReturn(new TreePath[]{path.getParentPath()});
TreeViewer v = mock(TreeViewer.class);
given(v.getContentProvider()).willReturn(contentProvider);
filter.setPattern("child");
assertThat(filter.isElementVisible(v, path.getLastSegment()), is(TRUE));
}