private void checkEventURI(final WonMessage message) { MessageEventPlaceholder event = messageEventRepository.findOneByMessageURI(message.getMessageURI()); if (event == null) { return; } else { if (hasResponse(event) && isDuplicateMessage(message, event)) { // the same massage as the one already processed is received throw new EventAlreadyProcessedException(message.getMessageURI().toString()); } else { throw new UriAlreadyInUseException(message.getMessageURI().toString()); } } }