### Question:
MatchBasedDiscoveryIO implements DiscoveryIO<E> { @Override public Set<Operation<E>> findOperationsConsuming(E input) { Map<E,T> targets = matchGraph.getTargetElementsMatchedBy(input); Set<Operation<E>> relevantOps = new HashSet<Operation<E>>(); for(E target : targets.keySet()){ Iterable<Operation<E>> result = provider.getOperationsWithInput(target); if (result != null){ relevantOps.addAll(Sets.newHashSet(result)); } } return relevantOps; } MatchBasedDiscoveryIO(MatchGraph<E, T> matchGraph, ServiceProvider<E> provider); @Override Set<Operation<E>> findOperationsConsuming(E input); @Override Set<Operation<E>> findOperationsProducing(E output);  }### Answer:
@Test public void testDiscoverOperationsForInput() throws Exception { Set<Operation<String>> result = matchDiscovery.findOperationsConsuming("x"); assertNotNull(result); assertEquals(2, result.size()); }