@@ -0,0 +1,2089 @@
+/*%0A * Copyright 2012 Research Studios Austria Forschungsges.m.b.H. Licensed under%0A * the Apache License, Version 2.0 (the %22License%22); you may not use this file%0A * except in compliance with the License. You may obtain a copy of the License%0A * at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable%0A * law or agreed to in writing, software distributed under the License is%0A * distributed on an %22AS IS%22 BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY%0A * KIND, either express or implied. See the License for the specific language%0A * governing permissions and limitations under the License.%0A */%0Apackage won.bot.framework.eventbot.filter.impl;%0A%0Aimport java.net.URI;%0A%0Aimport won.bot.framework.eventbot.event.Event;%0Aimport won.bot.framework.eventbot.event.ResponseEvent;%0Aimport won.bot.framework.eventbot.filter.EventFilter;%0Aimport won.protocol.message.WonMessage;%0Aimport won.protocol.message.WonMessageUtils;%0A%0A/**%0A * Accepts only ResponseEvents with the specified originalMessageURI.%0A */%0Apublic class LocalResponseEventFilter implements EventFilter %7B%0A    private URI responseSenderAtomURI;%0A    private URI originalMessageURI;%0A%0A    public LocalResponseEventFilter(final URI responseSenderAtomURI, final URI messageURI) %7B%0A        this.responseSenderAtomURI = responseSenderAtomURI;%0A        this.originalMessageURI = messageURI;%0A    %7D%0A%0A    public static LocalResponseEventFilter forWonMessage(WonMessage wonMessage) %7B%0A        return new LocalResponseEventFilter(%0A                        WonMessageUtils.getSenderAtomURIRequired(wonMessage),%0A                        wonMessage.getMessageURI());%0A    %7D%0A%0A    @Override%0A    public boolean accept(final Event event) %7B%0A        if (event instanceof ResponseEvent) %7B%0A            URI messageBeingRespondedTo = ((ResponseEvent) event).getOriginalMessageURI();%0A            URI senderOfResponse = ((ResponseEvent) event).getSenderAtomURI();%0A            return (this.originalMessageURI.equals(messageBeingRespondedTo)%0A                            && this.responseSenderAtomURI.equals(senderOfResponse));%0A        %7D%0A        return false;%0A    %7D%0A%7D%0A

Refactor bot classes