### Question:
DecisionComponents { void applyFilter() { hideAllItems(); showFilteredItems(); } DecisionComponents(); @Inject  DecisionComponents(final View view,
                              final DMNIncludeModelsClient client,
                              final ManagedInstance<DecisionComponentsItem> itemManagedInstance,
                              final DecisionComponentFilter filter,
                              final DMNDiagramsSession dmnDiagramsSession,
                              final DMNGraphUtils dmnGraphUtils); @PostConstruct void init(); View getView(); void refresh(); void removeAllItems();  }### Answer:
@Test public void testApplyFilter() { final DecisionComponentsItem item1 = mock(DecisionComponentsItem.class); final DecisionComponentsItem item2 = mock(DecisionComponentsItem.class); final DecisionComponentsItem item3 = mock(DecisionComponentsItem.class); final DecisionComponent component1 = mock(DecisionComponent.class); final DecisionComponent component2 = mock(DecisionComponent.class); final DecisionComponent component3 = mock(DecisionComponent.class); final List<DecisionComponentsItem> decisionComponentsItems = asList(item1, item2, item3); doReturn(new DecisionComponentFilter()).when(decisionComponents).getFilter(); doReturn(decisionComponentsItems).when(decisionComponents).getDecisionComponentsItems(); when(item1.getDecisionComponent()).thenReturn(component1); when(item2.getDecisionComponent()).thenReturn(component2); when(item3.getDecisionComponent()).thenReturn(component3); when(component1.getName()).thenReturn("name3"); when(component2.getName()).thenReturn("nome!!!"); when(component3.getName()).thenReturn("name1"); decisionComponents.getFilter().setTerm("name"); decisionComponents.applyFilter(); verify(item1).hide(); verify(item2).hide(); verify(item3).hide(); verify(item3).show(); verify(item1).show(); }