MultipleOutputHandler implements MavenInvocationOutputHandler<MultipleOutputHandler, Map<Class<? extends MavenInvocationOutputHandler>, Object>> { @Override public Map<Class<? extends MavenInvocationOutputHandler>, Object> getResult() { if (!executionStarted) { throw new IllegalStateException("Execution has not started. No results to return."); } Map<Class<? extends MavenInvocationOutputHandler>, Object> results = new HashMap<Class<? extends MavenInvocationOutputHandler>, Object>(); for (MavenInvocationOutputHandler handler : handlers) { if (!failedHandlers.containsKey(handler)) { results.put(handler.getClass(), handler.getResult()); } else { results.put(handler.getClass(), failedHandlers.get(handler)); } } return results; }  @Override void consumeLine(String line); @Override Map<Class<? extends MavenInvocationOutputHandler>, Object> getResult(); @Override MultipleOutputHandler copy();  }
@Test(expectedExceptions = IllegalStateException.class) public void throwsIfExecutionWasNeverStarted() { multiHandler.getResult(); }