### Question:
WorkItemDefinitionRemoteService implements WorkItemDefinitionService<WorkItemDefinitionRemoteRequest> { @Override public Collection<WorkItemDefinition> execute(final WorkItemDefinitionRemoteRequest request) { return fetch(lookupService, request.getUri(), request.getNames()); } WorkItemDefinitionRemoteService();   WorkItemDefinitionRemoteService(Function<String, WorkItemsHolder> lookupService); @Override Collection<WorkItemDefinition> execute(final WorkItemDefinitionRemoteRequest request); static Collection<WorkItemDefinition> fetch(final Function<String, WorkItemsHolder> lookupService,
                                                       final String serviceRepoUrl,
                                                       final String[] names); static Function<String, WorkItemsHolder> DEFAULT_LOOKUP_SERVICE; }### Answer:
@Test public void testExecute() { Collection<WorkItemDefinition> result = tested.execute(WorkItemDefinitionRemoteRequest.build(URL, new String[]{WD1_NAME, WD2_NAME})); assertFalse(result.isEmpty()); assertEquals(2, result.size()); assertTrue(result.stream().anyMatch(w -> WD1_NAME.equals(w.getName()))); assertTrue(result.stream().anyMatch(w -> WD2_NAME.equals(w.getName()))); }
@Test public void testExecuteFiltered1() { Collection<WorkItemDefinition> result = tested.execute(WorkItemDefinitionRemoteRequest.build(URL, new String[]{WD1_NAME})); assertFalse(result.isEmpty()); assertEquals(1, result.size()); assertTrue(result.stream().anyMatch(w -> WD1_NAME.equals(w.getName()))); }
@Test public void testExecuteFiltered2() { Collection<WorkItemDefinition> result = tested.execute(WorkItemDefinitionRemoteRequest.build(URL, new String[]{WD2_NAME})); assertFalse(result.isEmpty()); assertEquals(1, result.size()); assertTrue(result.stream().anyMatch(w -> WD2_NAME.equals(w.getName()))); }