ok so that would be better : ``` fun tryToDoNo...
# codereview
f
ok so that would be better :
Copy code
fun tryToDoNode(validEvents: List<String> = mutableListOf(),
                    node: Node, messageBody: MessageBody)
            : Observable<ServiceTaskResult> {
        return if (validEvents.isNotEmpty()) {
            validEvents.toObservable().map { notifyNextNode(node, it, messageBody) }
        } else {
            Observable.just(null)
        }
    }

    private fun notifyNextNode(node: Node, it: String, messageBody: MessageBody): ServiceTaskResult {
        if (logger.isDebugEnabled)
            logger.debug("${this.hashCode()}: The condition is valid for node ${node.id}, sending event $it with messageBody $messageBody")
        return ServiceTaskResult(it, messageBody)
    }