### Question:
AerialPlatformResultHandler implements ResultHandler, EventListener<ActiveDataGroupsChangedEvent> { @Override public List<Output> canHandle(List<Output> outputs) { List<Output> canHandles = New.list(); for (Output output : outputs) { if (ourPlatformLocationName.equals(output.getName()) || ourPlatformAttitudeName.equals(output.getName()) || ourGimbalAttitudeName.equals(output.getName())) { canHandles.add(output); } } return canHandles; } AerialPlatformResultHandler(Toolbox toolbox, OSHImageQuerier querier); @Override List<Output> canHandle(List<Output> outputs); @Override String getQueryProperty(Offering offering, Output output); @Override void handleGroupActivation(DataTypeInfo dataType, ActivationState state); @Override void handleResults(OSHDataTypeInfo dataType, List<Output> outputs, List<CancellableInputStream> streams); @Override void initializeType(OSHDataTypeInfo dataType); @Override void notify(ActiveDataGroupsChangedEvent event);  }### Answer:
@Test public void testCanHandle() { EasyMockSupport support = new EasyMockSupport(); DataRegistry dataRegistry = support.createMock(DataRegistry.class); UIRegistry uiRegistry = support.createMock(UIRegistry.class); PreferencesRegistry prefsRegistry = createPrefsRegistryBasic(support); Toolbox toolbox = createToolbox(support, dataRegistry, uiRegistry, prefsRegistry); OSHImageQuerier querier = support.createMock(OSHImageQuerier.class); List<Output> validOuts = createValidOutputs(); List<Output> invalidOuts = createInvalidOutputs(); support.replayAll(); AerialPlatformResultHandler handler = new AerialPlatformResultHandler(toolbox, querier); List<Output> totalOutputs = New.list(invalidOuts); totalOutputs.addAll(validOuts); List<Output> actualOuts = handler.canHandle(totalOutputs); assertEquals(validOuts, actualOuts); actualOuts = handler.canHandle(invalidOuts); assertTrue(actualOuts.isEmpty()); support.verifyAll(); }