class EnforcerErrorsOutputHandler implements MavenInvocationOutputHandler<EnforcerErrorsOutputHandler, Set<String>> {

    @Override
    public Set<String> getResult() {
        if (!executionStarted) {
            throw new IllegalStateException("Execution has not started. No results to return.");
        } else {
            return Collections.unmodifiableSet(errorMessages);
        }
    }

}